I have that JavaScript code:
var state = 'hidden';
function Show_Picture()
{
if (state == 'visible')
state = 'hidden';
else
state = 'visible';
document.getElementById('loader').style.visibility = state;
}
‘loader’ is the
<img alt="" id="loader" src="file:///D:/ajax-loader.gif"/>
Why that code doesn’t work on FF ? Ont the IE it works OK.
Here’s the code:
http://pastebin.com/m38aa1847
I actually can’t reproduce your bug. I copy-pasted your code from pastebin and ran it on FF 3.5.6 – the only thing I changed was the image source to a local image of my own.
Are you trying to debug it on FF at all? Try running it with Firebug open and see if any errors are reported.
Test the response code of the image request, too. Perhaps it’s the
file://protocol that isn’t working correctly.EDIT
Yup – just tested it. When I changed the image’s
srcto a fully-qualified local path (i.e., one withfile://) it doesn’t show up in Firefox. Your Javascript works fine – just change the image path.