I'm not sure which browsers are affected, but they are easy to check.
var img = new Image();
img.src = "foo.jpg";
if (img.complete || img.readyState === 4) {
doneCallback();
}
else {
$(img).on('load',doneCallback);
}
UPDATE
If you change the code around, it will constantly trigger a download event in all browsers.
var img = new Image();
$(img).load(doneCallback);
img.src = "foo.jpg";
source
share