I'm doing a very basic image load function in Jquery, this is the code I have:
$(document).ready(function(){
var img = new Image();
//
$(img).load(function () {
alert('loaded');
}).error(function () {
alert('error');
}).attr('src', 'images/loader.gif');
});
In firefox it works fine but in IE7 it just keeps alerting 'loaded' over and over again, if I change the URL so its a broken link it outputs 'error' just once.
Anyone know why this is happening?