I am trying to attach an event handler for the onerror
event (404 error) to a <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 on Chrome and Opera but it should work on IE9+ too. I found this, but I can't find a solution myself.
Is there a way to do that without writing an extra method to load styles dynamically?
NOTE: I didn't tag this question with 'jquery', so please don't use it in your answers.