消除控制台中的404 url错误? [英] Eliminate 404 url error in console?
本文介绍了消除控制台中的404 url错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试归因于源(src)缺失的404错误。
I try to eleminate an 404 error occuring because the source (src) is missing..
var $chart = $("<img />")
.addClass("trend-pic")
.error(function(){
console.log("error loading..")
});
try{
$chart.attr("src", jobs[counter].url + "test/trend")
}catch(err){
$chart.attr("src", "");
}
如果尝试了很多东西来捕捉错误, > .error(function(){})结尾。
使用 $ chart.load()
- 方法来检查图像是否被加载?
没有帮助?
if tried many stuff to catch the error i.e. putting an .error(function(){})
at the end.
use the $chart.load()
- method to check if the images gets loaded?
Non of those helped?
GET {myURLString} 404(找不到)
浏览器:Safari
Browser: Safari
推荐答案
404不是错误。这是服务器说没有源客户端引用的方式。
404 is not an error. It is the way server says it does not have the source referred by the client.
这篇关于消除控制台中的404 url错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文