HomelessDave
08-18-2005, 04:17 PM
The facts: I call the changeImages function from the body of the HTML document as follows:
<A HREF="#" ONMOUSEOVER="changeImages('freezeranimationmedium_01', 'images/freezeranimationmedium_01.gif'); return true;" ONCLICK="changeImages('freezeranimationmedium_01', 'images/freezeranimationmedium_01-c.gif');">
<IMG NAME="freezeranimationmedium_01" SRC="images/freezeranimationmedium_01.gif" alt="FreezerCrash" STYLE="border: 2px dashed black;"></A>
The changeImages function is this:
function changeImages() {
if (document.images ) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
The changeImages function sits in an external file HD.js which is referenced in the head of the document as follows:
<SCRIPT SRC="HD.js" type="text/javascript"> </SCRIPT>
The problem: Everything works fine in IE. For Mozilla, I get a 'changeImages is not defined' error on the Javascript console. When I stick the changeImages function right into the head (that is, no external *.js file) Mozilla likes it fine.
Surely there is support for external *.js files for Mozilla?! I'm hoping there's some obvious syntax error that IE forgives but Mozilla does not, which somebody can spot ... the page in question is at www.homelessdave.com/index.htm
Thanks in advance.
Cheers, HD
<A HREF="#" ONMOUSEOVER="changeImages('freezeranimationmedium_01', 'images/freezeranimationmedium_01.gif'); return true;" ONCLICK="changeImages('freezeranimationmedium_01', 'images/freezeranimationmedium_01-c.gif');">
<IMG NAME="freezeranimationmedium_01" SRC="images/freezeranimationmedium_01.gif" alt="FreezerCrash" STYLE="border: 2px dashed black;"></A>
The changeImages function is this:
function changeImages() {
if (document.images ) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
The changeImages function sits in an external file HD.js which is referenced in the head of the document as follows:
<SCRIPT SRC="HD.js" type="text/javascript"> </SCRIPT>
The problem: Everything works fine in IE. For Mozilla, I get a 'changeImages is not defined' error on the Javascript console. When I stick the changeImages function right into the head (that is, no external *.js file) Mozilla likes it fine.
Surely there is support for external *.js files for Mozilla?! I'm hoping there's some obvious syntax error that IE forgives but Mozilla does not, which somebody can spot ... the page in question is at www.homelessdave.com/index.htm
Thanks in advance.
Cheers, HD