Image Replacement (JS/JQuery) working in IE but not FF
- by Sunburnt Ginger
I have tried multiple solutions for replacing broken images (both JS & jQuery) and all work perfectly with IE but not in FF, is there a reason for this?
Are images handled differently in FF that may cause this?
JQuery Example:
$("img").error(function(){
$(this).unbind("error").attr("src", "nopic.jpg");
});
Javascript Example: (triggered by onError event in img tag)
function noimage(img){
img.onerror="";
img.src="nopic.jpg";
return true; }
Both of these examples work perfectly in IE but not at all in FF. What gives?
Thanks in advance!