jquery.imgloaded
jquery.imgloaded copied to clipboard
Load event fires twice, or not at all, in some cases
In some browsers (Chrome, and I think Firefox), code like
$('<img>')
.attr('src', 'http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif')
.load(function () {
alert(0);
});
fires fine without the imgloaded patch, but does not fire with it.
Code like
$('<img>')
.attr('src', 'http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif')
.load(function () {
$('<img>')
.attr('src', 'http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif')
.load(function () {
alert(0);
});
});
fires fine in Chrome and Firefox without the patch, but the inner load function does not fire in IE (because the image is cached), and neither load function fires with the patch (at least in chrome).
I have an experimental fork of this plugin at https://github.com/jefferyto/jquery.imgloaded/tree/pi . Can you give it a try? I'd like to get some feedback before submitting a pull request. Thanks!