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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    The javascript console in IE6 WIN

    The javascript console in IE6 WIN gave this error: object not found
    document.getElementById(' ') ...

    In Opera's 7.24 javascript console no errors ....

    The only answer I found is that IE might not find the appropriate variables ...??

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Where's the code?

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    in the head

    Code:
    <script type="text/javascript">
    function unhideSmallDivs() {
    if (!document.getElementById) {return;}
    document.getElementById('div1').style.visibility = "visible";
    document.getElementById('div2').style.visibility = "visible";
    document.getElementById('div3').style.visibility = "visible";
    document.getElementById('div4').style.visibility = "visible";
    }
    
    </script>

    In the body

    Code:
    <div id="wrapperlargeImage" style="z-index:1;">
    <img id="largeImage" src="largeImage.jpg" width="732" height="460" alt="">
    </div>
    <script type="text/javascript">
    
    document.getElementById('largeImage').onload = function()
    {
         unhideSmallDivs(); }
    
    </script>

  • #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,696
    Thanks
    0
    Thanked 232 Times in 227 Posts
    Hi there _com,

    I tested this in IE 6.02 with XP and it worked OK...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Strict XHTML 1.0 Template</title>
    
    <base href="http://coothead.homestead.com/files/"/>
    
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
    <meta name="Content-Script-Type" content="text/javascript"/>
    <meta name="Content-Style-Type" content="text/css"/>
    
    <style type="text/css">
    /*<![CDATA[*/
    #div1,#div2,#div3,#div4 {
         visibility:hidden;
     }
    #wrapperlargeImage {
         text-align:center;
         z-index:1;
     }
    /*//]]>*/
    </style>
    
    <script type="text/javascript">
    //<![CDATA[
    function unhideSmallDivs() {
    if (!document.getElementById) {
       return;
     }
         document.getElementById('div1').style.visibility = "visible";
         document.getElementById('div2').style.visibility = "visible";
         document.getElementById('div3').style.visibility = "visible";
         document.getElementById('div4').style.visibility = "visible";
     }
    //]]>
    </script>
    
    </head>
    <body>
    
    <div id="wrapperlargeImage"><img id="largeImage" src="c1.gif"alt=""/></div>
    
    <div id="div1">this is div number one</div>
    <div id="div2">this is div number two</div>
    <div id="div3">this is div number three</div>
    <div id="div4">this is div number four</div>
    
    <script type="text/javascript">
    
         document.getElementById('largeImage').onload = function() {
         unhideSmallDivs(); 
     }
    
    </script>
    </body>
    </html>
    
    
    
    
    
    ...see if it works for you.

    coothead

  • #5
    Regular Coder
    Join Date
    Mar 2005
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there are other scripts too ... there is the problem maybe


    thanks for the effort.

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #7
    Regular Coder
    Join Date
    Mar 2005
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The javascript console in IE6 WIN gave this error: object not found
    document.getElementById(' ') ...

    could this be when testing locally

    ...

    and yes: FTP uploaded all the page, external js, css and XP IE6 WIN:

    no errors what so ever

    So can one assume the JS console in IE6 WIN to test locally pages behaves differently ??

    The JS console in IE cannot even say the actual line the error might be - it counts the lines differently ...
    Last edited by _com; 07-12-2005 at 05:11 PM. Reason: could this be when testing locally


  •  

    Posting Permissions

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