A script with alert works fine. But when I comment the alert (actually I need to), the browser Mozilla 3 hangs and IE6 cease to function with an error message.
SCRIPT (With the alert. When the alert is commented, the script fails as stated above):
var myImage = new Image;
myImage.src = "./images/allback.jpg";
var chk= false;
[COLOR="Red"]alert(chk+' / '+i);
IE6 ERROR MESSAGE:
A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?
If 'yes' is chosen the page loads without the execution of the script. Otherwise it hangs.
I need a way out.
P.S.: As per the above code, I need to check if an image is completely loaded or not. Any alternative suggestions are welcome. But I'd like to know why the current code fails. Thanks in advance.