08-03-2004, 09:10 PM | #1 (permalink) | |
Upright
Location: Indianapolis
|
javascript help!
i never noticed this error but on some people's puters it's popping up with an XP popup with these errors:
Errors: Line: 54 Char: 5 Error: 'document.images[...]' is null or not an object Code:0 Line: 49 Char: 5 Error: 'document.images[...]' is null or not an object Code:0 Line: 61 Char: 1 Error: Object expected Code:0 here's the code Quote:
anybody know anyone who can help figure this out? or at least point me in the javascript messageboard help direction? |
|
08-03-2004, 09:46 PM | #2 (permalink) |
Crazy
Location: Salt Lake City
|
It's been a while since I touched Javascript, but if my memory does not fail me, some browsers don't support the document.images[] type of command.
I wish I could help more. Try these sites: Netscape's devedge JavascriptKit (rather commercial) Maybe somebody else can be more specific. Cheers.
__________________
---<>---^^---<>---^^---<>--- ---^^---<>---^^---<>---^^--- ---<>---^^---<>---^^---><--- |
08-19-2004, 10:31 AM | #5 (permalink) |
Junkie
|
Another thing that may be happening is that the JavaScript that refers to those IMG elements is getting called before the browser parses the IMG tag, in which case the elements may not exist in the Document Object Model yet even though they do exist in the HTML file.
For small images such as buttons, I usually dispense with all the preloader crap in the document's HEAD and just set an IMG tag's source to an absolute URL in the mouseover and mouseout code, like so: HTML Code:
<a href="home.html" onmouseover="document.images['button1'].src='home_rollover.gif';" onmouseout="document.images['button1'].src='home_default.gif';"><img name="button1" src="home_default.gif" border="0"></a> By the way, the "if (document.images)" tests in your code are unnecessary, since every DOM and older DHTML model (e.g., IE4 & NS4) has a document.images collection - there's no need to test for it. |
08-21-2004, 09:38 AM | #7 (permalink) | |
Upright
|
Can you post an example onmouseover = "..." call for us ?
Quote:
|
|
Tags |
javascript |
|
|