I am trying to attach an event handler for the onerror event (error 404) to the <link> element.
I have something like this on my page:
<link rel="stylesheet" type="text/css" href="dead/link.css" onerror="handle404Error()" />
It works fine in Chrome and Opera, but it should work on IE9 + too. I found this one , but I can not find the solution myself.
Is there a way to do this without writing an additional method for dynamically loading styles?
NOTE. I did not mark this question with "jquery", so please do not use it in your answers.
javascript html html5 error-handling
marcel
source share