图片出错再加载js
程序员文章站
2022-06-12 21:06:14
...
var img=pic.find("img"); img.attr("src","http://pic1"); img.bind("error",function(){ img.unbind("error");//防止死循环 img.attr("src","http://pic2"); });