Download IE Internet Explorer Wallpaper

Download IE Internet Explorer Wallpaper

Hi to everybody,
recently i’ve got a problem with few lines of javascript code:

obj = new Image()
obj.src =_imageToShow;
obj.onload = function loaded()
{
// do something..
}

In Internet Explorer 6 o 7, if the image is already in cache the loaded function isn’t called.
In Firefox or other (decent) browsers you do not experience this problem.
This is because Internet Explorer throws the onload event immediately if the image is already in cache.
To avoid this problem you have to exchange the order of the 2 lines about src and onload assignment:

obj = new Image()
obj.onload = function loaded()
{
// do something..
}
obj.src =_imageToShow;