Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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", "");
}    

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 (Not Found)

Browser: Safari

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
331 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can't really delete those 404 errors from the console. The best you can do is make some ajax calls and see the return code, but then you'll be limited to request only to your own domain.

EDIT--

Oh, and yes, those errors will keep showing in the "Requests" tab! They just won't appear in the "Console" tab (in Chrome).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...