// evil:
var image = new Image();
image.src = 'image.jpg';
image.onload = function() {
// sometimes called
alert('image loaded');
};
// good:
var image = new Image();
image.onload = function() {
// always called
alert('image loaded');
};
image.src = 'image.jpg';
To be honest, I'm not sure if this works or not, especially in Safari 1.x and Opera, but I'll give it a shot. The only other work around I've seen is pretty complicated.
Thanks to http://www.thefutureoftheweb.com/blog/image-onload-isnt-being-called for posting this.
No comments:
Post a Comment