dhtml problem in safari

Discussion in 'ASP General' started by Patrice, Feb 18, 2005.

  1. Patrice

    Patrice Guest

    Hi,
    This code works with ie but not with safari:


    function montre(id,this_nb,nb,shtml) {
    if (document.getElementById) {
    document.getElementById(id).style.visibility = 'visible';
    } else if (document.all) {
    document.all[id].style.visibility = 'visible';
    } else if (document.layers) {
    document.layers[id].visibility = 'visible';

    };

    var el = (document.getElementById)? document.getElementById(id):
    (document.all)? document.all[id]: (document.layers)? document.layers[id]:
    null;
    if (!el) return;
    if (typeof el.innerHTML!="undefined") {
    el.innerHTML = shtml;
    } else if (document.layers) {
    el.document.write(shtml);
    el.document.close();
    }

    }

    Can someone tells me what to do to make it workm on both browsers?
    Thx.
    Pat
    Patrice, Feb 18, 2005
    #1
    1. Advertising

  2. Patrice

    Roland Hall Guest

    "Patrice" <> wrote in message
    news:e4dRd.13486$...
    : Hi,
    : This code works with ie but not with safari:
    :
    :
    : function montre(id,this_nb,nb,shtml) {
    : if (document.getElementById) {
    : document.getElementById(id).style.visibility = 'visible';
    : } else if (document.all) {
    : document.all[id].style.visibility = 'visible';
    : } else if (document.layers) {
    : document.layers[id].visibility = 'visible';
    :
    : };
    :
    : var el = (document.getElementById)? document.getElementById(id):
    : (document.all)? document.all[id]: (document.layers)? document.layers[id]:
    : null;
    : if (!el) return;
    : if (typeof el.innerHTML!="undefined") {
    : el.innerHTML = shtml;
    : } else if (document.layers) {
    : el.document.write(shtml);
    : el.document.close();
    : }
    :
    : }
    :
    : Can someone tells me what to do to make it workm on both browsers?

    Perhaps in a DHTML or client-side j(ava)script NG, preferably with Safari
    support. This is ASP related (server-side scripting) at a Safari competitor
    newsserver.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 18, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MingChih Tsai

    A DHTML Problem !!

    MingChih Tsai, Mar 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    372
    bruce barker
    Mar 17, 2005
  2. John Smith
    Replies:
    5
    Views:
    55,897
    altamir
    Dec 18, 2003
  3. mark | r
    Replies:
    4
    Views:
    583
    Toby Inkster
    Sep 2, 2004
  4. Steve
    Replies:
    1
    Views:
    271
    Richard Cornford
    Apr 9, 2005
  5. Replies:
    1
    Views:
    108
Loading...

Share This Page