On 1-Dec-09, at 6:51 AM, Lex Spoon wrote: > On Mon, Nov 30, 2009 at 10:28 PM, Matt Mastracci <matt...@mastracci.com > > wrote: >> 2. onerror works some of the time in some of the browsers. It >> fails on >> various combinations of resolve errors, error status codes and >> other failure >> conditions. For all browsers (except Opera) that don't support it >> directly, >> It can be emulated with onreadystatechange/onload and lack of a JSONP >> callback. > > Can you expand on that? IE has script-tag callbacks that should be > usable to detect download errors. What did you get working on other > browsers? > > If there's a way to detect download failures on Firefox and on > Webkit-based browser, then JSONP downloads are better than I thought.
I've got a set of testcases that I ran through on each browser. You can see one of them here: http://grack.com/errortest3.html I couldn't get onerror to fire on script elements in every browser. It'll fire in Firefox, Safari and Chrome, but IE will only fire the readystatechange events on error. You can work around this by setting a global as each script fragment is loaded, then testing against that global in the onreadystatechange or onload event handlers. Do you know how to get onerror to fire in IE? It didn't seem to work in my testing. The errors that are available in the event handlers aren't really useful for details on the failure (that's pretty universal, sadly). Matt. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
