Timeline for How to tell if a <script> tag failed to load
Current License: CC BY-SA 2.5
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 23, 2012 at 17:06 | comment | added | Jo Liss | Thanks flussence. Too bad that this only works for 404, not for JS errors. Setting a variable inside the script is not always practicable. | |
Jan 1, 2012 at 3:12 | comment | added | user42092 |
@hippietrail - an event listener will never work on a static HTML <script> . If you try to add it before then you get an error that the tag doesn't exist, and if you add it after then the script's already run and triggered its events. The only way there is to look for side effects caused by the script.
|
|
Dec 26, 2011 at 21:50 | comment | added | hippietrail | Should this work for statically included script tags too, or just ones injected dynamically? I just tried to use it to detect if jQuery failed to load but it didn't work. I'm not sure if I'm doing it wrong or it just doesn't work in this case. | |
Feb 11, 2009 at 21:53 | comment | added | user42092 | I had a problem with an onclick handler in safari and this was what fixed it, so I thought it'd be the same for onerror too. Apparently not... | |
Feb 11, 2009 at 21:35 | comment | added | David | That actually doesn't make any difference for Safari -- it still doesn't fire the error handler. | |
Feb 11, 2009 at 21:18 | history | answered | user42092 | CC BY-SA 2.5 |