...

View Full Version : The javascript console in IE6 WIN



_com
07-12-2005, 02:15 PM
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 ...??

glenngv
07-12-2005, 02:31 PM
Where's the code?

_com
07-12-2005, 03:38 PM
in the head


<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


<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>

coothead
07-12-2005, 04:43 PM
Hi there _com,

I tested this in IE 6.02 with XP and it worked OK...

<!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

_com
07-12-2005, 05:18 PM
there are other scripts too ... there is the problem maybe


thanks for the effort.

Willy Duitt
07-12-2005, 05:50 PM
Continued from here: http://www.codingforums.com/showthread.php?t=62678

_com
07-12-2005, 06:02 PM
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 ...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum