0

I have something like this:

<img src="/images/kjh5kh.jpg" onerror="myScript" />

myScript is replacing the images, which were not found. It works great, but i don't want to see browser's console full of errors. So, how could i catch the errors and prevent them from being logged in console?

stkvtflw
  • 12,092
  • 26
  • 78
  • 155
  • 1
    Possible duplicate of [Can I prevent the Chrome Developer Tools console from logging image 404 errors?](http://stackoverflow.com/questions/14337351/can-i-prevent-the-chrome-developer-tools-console-from-logging-image-404-errors) – Aminadav Glickshtein Nov 18 '15 at 15:50
  • 1
    Ajax a head first before setting the source? – mplungjan Nov 18 '15 at 15:53
  • 1
    [_**Here**_](http://stackoverflow.com/questions/3984287/how-to-show-alternate-image-if-source-image-is-not-found-onerror-working-in-ie) a good explanation around this problem –  Nov 18 '15 at 15:54
  • Thanks for help, guys! nAz, your url is most helpful, thanks again! – stkvtflw Nov 18 '15 at 15:58

0 Answers0