1
我必须隐藏破碎图片,图片的源代码为空或源代码链接错误,并替换为医生档案页的占位符图片。我在Chrome中的工作正常,但在IE和FF中,破碎的图像被隐藏起来,但不会被占位符图像取代?我不明白为什么?用占位符图片代替损坏的图片
$(function() {
$("img.PhysicianImage").one("load", function() {
$(this).show();
}).each(function() {
if (this.complete) $(this).load();
}).error(function() {
$(this).unbind("error").attr("src", "http://mysite/Physician%20Images/no_photo.jpg");
}).hide();
});