0

I have this code:

$(function(){
    var stime=0,td=0;
    pingend=function(){
        if(td<2){
            pingstart();
            td++;
        }else if(td!=-1){
            $("#ping_image_add").html(Math.round(new Date().getTime()-stime)+"ms");
            td=-1;
        }
    }
    pingstart=function(){
        stime = new Date().getTime();
        $("#ping_image_add").html("Testing... <img id=\"ping_image\" src=\"http://87.98.243.201/"+stime+"\" />");
        $("#ping_image").bind("error").error(
            function() {
                pingend();
            }).ready( function() {
                pingend;
        });
    }
    pingstart();
});

the code works fine, but in the console say:

1471126250760:1 GET http://87.98.243.201/1471126250760 404 (Not Found)

and this code is for do ping to server on client side, and is the only way which i founded, how i can hide that error message?

iZume
  • 119
  • 1
  • 11
  • This is logged by the browser itself, so the answer would be browser specific. You can refer http://stackoverflow.com/questions/14337351/can-i-prevent-the-chrome-developer-tools-console-from-logging-image-404-errors – Akshendra Pratap Aug 13 '16 at 22:21
  • 1
    Do you mean that 404 is actually working? Why do you return 404 then? Change the response code to 200 and browser won't log it. – Adam Azad Aug 13 '16 at 22:23
  • [Check if image exists on server using JavaScript?](http://stackoverflow.com/questions/18837735/check-if-image-exists-on-server-using-javascript) – adeneo Aug 13 '16 at 22:47

0 Answers0