js detect image 404,read the HTTP header to check for 404 with jQuery without performing an ajax request
js detect image 404:
一、用Ajax,代码量较长:
二、用图像的onerror函数实现判断404,实践OK:
_________________________________________________________________________
来自:http://forums.mozillazine.org/viewtopic.php?f=25&t=315570
Hello All,
can do this either by Jquery or Javascript...
来自:
http://www.coderanch.com/t/624410/HTML-CSS-JavaScript/check-url-returns-error-status
一、用Ajax,代码量较长:
二、用图像的onerror函数实现判断404,实践OK:
_________________________________________________________________________
来自:http://forums.mozillazine.org/viewtopic.php?f=25&t=315570
Hello All,
can do this either by Jquery or Javascript...
来自:
http://www.coderanch.com/t/624410/HTML-CSS-JavaScript/check-url-returns-error-status
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/7109/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2014-3-24 18:24
评论列表