On 15-Dec-09, at 12:48 PM, Lex Spoon wrote: > I've now double checked on several browsers other than Opera, and I > agree that onerror works on non-IE and onreadystatechange works on IE. > Details here: > > http://blog.lexspoon.org/2009/12/detecting-download-failures-with-script.html > > One tricky aspect is that I don't see how to get IE to say whether or > not the download really failed. Sometimes the "loaded" state is > reached when loading a page that is not in cache.
I just ran some further tests - it looks like 'complete' is always fired while cached, 'loaded' always when not cached (and always after a loading event). Note that it will also fire 'interactive' sometimes if you use alert() from the script, or if the 'error on page' dialog pops up. I can't quite pin down the circumstances in which this readystate chooses to fire. I whipped up a slightly improved test based on your post that logs the order of events here: http://grack.com/errortest.html For all of the cached/uncached runs I did on IE6, IE7 and IE8 the script was always evaluated before complete or loaded was fired. Matt. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors