function setImageUrl() { $('#ImageTest') .error(function() { alert('Handler for .error() called.') setTimeout( setImageUrl , 300 ) }) .attr("src", $imageURL); } setImageUrl()
function checkImageUrl() { $('#ImageTest') .error(function() { setTimeout("checkImageUrl()", 2000); }) $('#ImageTest').load(function() { window.location.replace(redirectURL); }); $('#ImageTest').attr("src", imageURL + "?=" + d.getTime()); } checkImageUrl();
You were right :D Just does nothing after the first event in IE, I guess changing the image url doesn't force a reload of the image.
I have, however, got it working by forcing a page refresh. I'll try and figure out how to get IE to reload the image because it's much cleaner, but at least I can make it work regardless.