{"id":817,"date":"2012-03-15T03:32:23","date_gmt":"2012-03-14T19:32:23","guid":{"rendered":""},"modified":"2014-03-11T22:41:34","modified_gmt":"2014-03-11T14:41:34","slug":"img%e7%9a%84onerror%e5%b1%9e%e6%80%a7%e5%80%bc","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2012\/03\/15\/817.htm","title":{"rendered":"img\u7684onerror\u5c5e\u6027\u503c"},"content":{"rendered":"<p>&nbsp;img\u4e2d\u7684onerror\u4e8b\u4ef6\u53ef\u4ee5\u5728\u56fe\u7247\u53d1\u751f\u6210\u9519\u8bef\u89e6\u53d1\u4e00\u4e2a\u4e8b\u4ef6,\u6bd4\u5982\u5f53\u56fe\u7247\u52a0\u8f7d\u5931\u8d25\u65f6,\u7528onerror\u4e3a\u5f53\u524dimg\u6307\u5b9a\u4e00\u4e2a\u9ed8\u8ba4\u56fe\u7247. php\u7a0b\u5e8f\u5458\u7ad9<\/p>\n<div>\u7528\u6cd5<\/div>\n<div>&lt;img src=&rdquo;jz1024.gif&rdquo; onerror=&rdquo;javascript:this.src=&rsquo;\/noPic.gif&rsquo;;&rdquo; alt=&rdquo;pic&rdquo; \/&gt;<\/div>\n<div>\u4f46\u6709\u65f6\u4f7f\u7528\u4e0d\u5f53\u5728ie\u5185\u6838\u7684\u6d4f\u89c8\u5668\u4e0b\u4f1a\u65e9\u6210\u6b7b\u5faa\u73af.\u6bd4\u5982\u5f53\u56fe\u7247\u52a0\u8f7d\u4e0d\u6210\u529f\u65f6\u89e6\u53d1\u52a0\u8f7d\u9ed8\u8ba4\u56fe\u7247,\u95ee\u9898\u6765\u4e86,\u5982\u679c\u9ed8\u8ba4\u56fe\u7247\u4e5f\u4e0d\u5b58\u5728\u6216\u52a0\u8f7d\u5931\u8d25\u5462,\u5728ie\u4e0b\u5c31\u4f1a\u53cd\u590d\u7684\u52a0\u8f7d. php\u7a0b\u5e8f\u5458\u7ad9<\/div>\n<div>\u9020\u6210\u4ee5\u4e0b\u7684\u8fd9\u79cd\u9519\u8bef,\u5982\u56fe<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>\n<p><a target=\"_blank\" href=\"\/UploadFiles\/201203\/20120316qv6jbg.jpg\"><img decoding=\"async\" border=\"0\" alt=\"\" src=\"\/UploadFiles\/201203\/20120316qv6jbg.jpg\" \/><\/a><\/p>\n<\/div>\n<div>&nbsp;<\/div>\n<div>\u5728\u5b9e\u9645\u7684\u9879\u76ee\u4e2d\uff0cimg\u7684onerror\u5c5e\u6027\u503c\u662f\u5f88\u91cd\u8981\u7684\uff0c\u6bd4\u5982\u50cf\u5e7f\u544a\u4f4d\u90a3\u91cc\u7684\u5e7f\u544a\uff0c\u5982\u679c\u8def\u5f84\u4e0d\u5bf9\uff0c\u6216\u8005\u670d\u52a1\u5668\u4e0a\u7684\u56fe\u7247\u88ab\u5220\u9664\u7684\u8bdd\uff0c\u90a3\u4e48\u6240\u663e\u793a\u7684\u6548\u679c\u80af\u5b9a\u4e0d\u662f\u6211\u4eec\u60f3\u8981\u7684\u4e86\u3002<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; \u4f46\u662f\uff0c\u8fd9\u4e2a\u5c5e\u6027\u4f3c\u4e4e\u4e0d\u88abw3c\u6240\u627f\u8ba4\uff0c\u56e0\u4e3a\u6211\u7528\u706b\u72d0\u7684\u6821\u9a8c\u5de5\u5177\uff0c\u603b\u662f\u5728\u90a3\u5757\u5730\u65b9\u63d0\u793a\u6709\u9519\u8bef\uff0c\u4e0d\u77e5\u9053\u5927\u5bb6\u6709\u6ca1\u6709\u89e3\u51b3\u7684\u529e\u6cd5\u3002<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; \u540c\u65f6\u4e5f\u60f3\u8bf4\u7684\u662f\uff0c\u614e\u7528onerror\u5c5e\u6027\u503c\uff0c\u7528\u7684\u4e0d\u597d\uff0c\u53ef\u80fd\u4f1a\u5f39\u51fa\u4e00\u4e2a&ldquo;stack overflow at line:0&rdquo;\u7684\u5bf9\u8bdd\u6846\u3002<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; \u7f51\u4e0a\u627e\u4e86\u4e00\u4e0b\u5173\u4e8e&ldquo;stack overflow at line:0&rdquo; \u7684\u8bf4\u6cd5\uff0c\u4f46\u662f\u7f51\u4e0a\u7684\u8bf4\u6cd5\u662f\u5806\u6808\u7684\u76ca\u51fa\uff0c\u5f53\u7136\u6211\u4e0d\u6392\u9664\u8fd9\u79cd\u53ef\u80fd\u6027\uff0c\u4f46\u662fonerror\u8fd9\u4e2a\u5c5e\u6027\u503c\u4e5f\u6709\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8fd9\u4e2a\u95ee\u9898\u3002<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; \u4ee3\u7801\u5982\u4e0b\uff1a<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&lt;script type=&quot;type\/javascript&quot;&gt;<\/div>\n<div>&nbsp;<\/div>\n<div>function showOtherPic(obj){&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>obj.src=&#8217;jz1024.jpg&#8217;;<\/div>\n<div>&nbsp;<\/div>\n<div>obj.onerror = null;<\/div>\n<div>&nbsp;<\/div>\n<div>}<\/div>\n<div>&nbsp;<\/div>\n<div>&lt;\/script&gt;<\/div>\n<div>&nbsp;<\/div>\n<div>&lt;img src=&quot;&quot; onerror=&quot;showOtherPic(this)&quot; \/&gt;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp;\u5982\u679c\u4e00\u4e0d\u5c0f\u5fc3\uff0c\u5c06obj.src\u7684\u8def\u5f84\u5199\u6210\u4e86\u4e00\u4e2a\u9519\u8bef\u7684\u5730\u5740\uff0c\u5373\u627e\u4e0d\u5230\u56fe\u7247\u65f6\uff0c\u5c31\u4f1a\u62a5&rdquo;stack overflow at line:0&ldquo; \uff0c\u5047\u8bbe\u9996\u9875\u7684\u56fe\u7247\u90fd\u662f\u5faa\u73af\u8bfb\u53d6\uff0c\u5f53\u6ca1\u6709\u56fe\u7247\u65f6\uff0c\u800conerror\u7684\u56fe\u7247\u5730\u5740\u53c8\u5199\u9519\u65f6\uff0c\u90a3\u771f\u662f\u676f\u5177\u4e86\uff0c\u8981\u4e0d\u65ad\u5730\u5f39\u51fa\u8fd9\u4e2a\u6846\uff0c\u76f4\u5230\u56fe\u7247\u7ed3\u675f\u4e3a\u6b62,\u4e5f\u53ef\u4ee5\u5199\u4e2a\u5224\u65ad\uff0c\u56fe\u7247\u5b58\u5728\u4e0d\u5b58\u5728\uff0c\u4e0d\u8fc7\u6ca1\u4ec0\u4e48\u5927\u7684\u5fc5\u8981\uff01<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>\u8bf4\u660e\uff1a\u5982\u679c\u56fe\u7247\u5b58\u5728\uff0c\u4f46\u7f51\u7edc\u5f88\u4e0d\u901a\u7545\uff0c\u4e5f\u53ef\u80fd\u89e6\u53d1 onerror\u3002<\/div>\n<div>&nbsp;<\/div>\n<div>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/div>\n<div>&nbsp;<\/div>\n<div>\u7b2c\u4e00\u79cd\uff1a\u53bb\u6389 onerror \u4ee3\u7801\uff1b\u6216\u8005\u66f4\u6539 onerror \u4ee3\u7801\u4e3a\u5176\u5b83\uff1b\u6216\u8005\u786e\u4fdd onerror \u4e2d\u7684\u56fe\u7247\u8db3\u591f\u5c0f\uff0c\u5e76\u4e14\u5b58\u5728\u3002<\/div>\n<div>&nbsp;<\/div>\n<div>\u7b2c\u4e8c\u79cd\uff1a<\/div>\n<div>&nbsp;<\/div>\n<div>&lt;script type=&rdquo;text\/javascript&rdquo;&gt;&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&lt;!&ndash;&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>function nofind(){&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>var img=event.srcElement;&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>img.src=&quot;\/img\/default.gif&quot;;&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>img.onerror=null; \u63a7\u5236onerror\u4e8b\u4ef6\u53ea\u89e6\u53d1\u4e00\u6b21&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>}&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>\/\/&ndash;&gt;&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&lt;\/script&gt;&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>&lt;img src=&quot;\/img\/jz1024.jpg&quot; onerror=&rdquo;nofind();&rdquo; \/&gt;<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;img\u4e2d\u7684onerror\u4e8b\u4ef6\u53ef\u4ee5\u5728\u56fe\u7247\u53d1\u751f\u6210\u9519\u8bef\u89e6\u53d1\u4e00\u4e2a\u4e8b\u4ef6,\u6bd4\u5982\u5f53\u56fe\u7247\u52a0\u8f7d\u5931\u8d25\u65f6,\u7528onerror\u4e3a\u5f53\u524dimg\u6307\u5b9a\u4e00\u4e2a\u9ed8\u8ba4\u56fe\u7247. php\u7a0b\u5e8f\u5458\u7ad9 \u7528\u6cd5 &lt;img src=&rdquo;jz1024.gif&rdquo; &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-817","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=817"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/817\/revisions"}],"predecessor-version":[{"id":66643,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/817\/revisions\/66643"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=817"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=817"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}