Hello,
This was a tough thing to find in the archives, so I apologise if it is an already answered question:
I have found that IE6 happily lets me change the src of an image in any JavaScript function, whereas Mozilla Firefox 1.5 does not. Having looked at JavaScript documentation, I do not understand why there is a difference.
This code:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “
<HTML>
<HEAD>
<TITLE>Image Zoom Window – The page that opened this window is behind it</TITLE>
</HEAD>
<BODY>
<DIV align=”center”>
<P>In IE6, the image appears as part of the page load; in Mozilla Firefox 1.5
only putting the mouse over the blank image causes the full image to
appear.</P>
<SCRIPT type=”text/javascript”>
<!–
var dummy2 = new Image();
dummy2.src =location.search.substring(1);
//–>
</SCRIPT>
<IMG name=”dummy” alt=”fred” onmouseover=”dummy.src = dummy2.src” border=”1″ />
<SCRIPT type=”text/javascript”>
<!–
dummy.src = dummy2.src;
//–>
</SCRIPT>
</DIV>
</BODY>
</HTML>
(which can be tried at: [url]http://213.162.107.39/test/Debug.html?Bergerac.jpg
Can anybody explain to me why, and (hopefully) show me how to make the 2nd block of JavaScript work in Firefox – so the full image loads w/o having to run the mouse pointer over the blank image?