var imgLoader = $("<img />");
$(imgLoader).attr("src", "http://localhost/malevil/Content/Images/img_adrenalin.jpg");
$(imgLoader).unbind('load');
$(imgLoader).bind('load', function () {
alert("event fired");
});
But this work only in chrome, where is the problem ?
In IE, Firefox and Opera load event never fired.
You need to bind the load event before you set the
srcproperty.As a side note, there are known issues with the load event on images that you need to be aware of:
And, quoting from the jQuery manual on
load():