#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    2
    Rep Power
    0

    javascript function problem with non-IE browsers


    I'm having trouble getting the the following ExpandNode function to work under anything other than IE5 (under which it works well). The general script is:

    <script language="JavaScript"><!--

    function ExpandNode( node, image ) {
    target = node;

    if( target.style.display == "none" ) {
    target.style.display = "block";
    document[ image ].src = "<?= ImageHref( LINK_IMAGE_MINUS ); ?>";
    } else {
    target.style.display = "none";
    document[ image ].src = "<?= ImageHref( LINK_IMAGE_PLUS ); ?>";
    }
    }

    if( top != self ) {
    top.location = self.location;
    }

    // --></script>


    When called, it looks like so:


    javascript:ExpandNode(this.node_challenge_$_cycle,'challenge_$_cycle')


    and is read by the browser, as an example, as follows:


    javascript:ExpandNode(this.node_challenge_2,'challenge_2')


    Any ideas?


    Erik
    Last edited by erikg; August 15th, 2001 at 01:32 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    Toronto, Ontario, Canada
    Posts
    631
    Rep Power
    14
    The document.all.obj.style.display is a property only used by IE5+.

    IE4: document.all["obj"].style.visibility="hidden/visible"
    NS4: document.layers["obj"].visibility="hide/show"
    NS6: document.getElementById("obj").style.visibility="hidden/visible" This is also supported by IE5+ .

IMN logo majestic logo threadwatch logo seochat tools logo