Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2002
    Location
    Washington, DC
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DOM issues with CSS

    Hey, everyone.

    I have a javascript function that switched the display property for a series of DIVs on my page. This works in IE 6 and NS 7:
    Code:
    function toggle_folder(id){
    	var folderx = "folder" + id;
    	if (document.getElementById(id).style.display == "block"){
    		document.getElementById(id).style.display = "none";
    		document.getElementById(folderx).src="closed.gif";
    	}else{
    		document.getElementById(id).style.display = "block";
    		document.getElementById(folderx).src="open.gif";
    	}
    }
    My question is in regards to the IE 5.X DOM; does it support the getElementById method, or do I need to use the document.all? I am waiting for my sys admin to come by and modify my permissions so I can install IE 5 and test it, but I thought I'd ask here as well. So if anyone knows the answer to this, I'd appreciate the help!

    Thanks!
    japangreg

    [to the mods: not sure if this belongs in the CSS or DOM forum. If it is posted incorrectly, I apologize and ask for you to please move it to the proper forum. Thanks!]
    Last edited by japangreg; 11-01-2002 at 05:50 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.getElementById is supported by IE 5.0 and later.

  • #3
    New Coder
    Join Date
    Sep 2002
    Location
    Washington, DC
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Roy. I had a feeling, but I wasn't sure.

    Another question just came up (not really related to CSS or DOM issues); when I get the appVersion for IE, it returns 4.0 (compatable; MSIE 6.0; blah blah blah...) Now, under Help -> About Internet Explorer, it says I am running version 6. Which is it? I'm getting confused...

    Anyway, thanks again!
    japangreg

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The responses you get from appVersion should be considered a pack of lies in just about every browser. What's displayed there was and often still is used to determine whether a browser can handle various "features" and as new versions of browser came out with new capabilities they often "fudged" the appVersion to keep it compatible with those scripts rather than listen to complaints about how their fancy new browser broke a bunch of web sites (reality is that the web sites are broken but it's usually the browser vendor that gets the blame).

  • #5
    New Coder
    Join Date
    Sep 2002
    Location
    Washington, DC
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Now, is that true for logs from our server as well? Over 50% of our visitors are running IE 5.X... or are they...?

    Maybe it's just easier to ask which browser/version combinations my code above will fail under; obviously, I'm pretty confused about the DOM issue...

    Thanks again Roy.
    japangreg


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •