+ // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+ // Opera doesn't fire onreadystatechange at all on abort
+ try {
+ var oldAbort = xhr.abort;
+ xhr.abort = function() {
+ oldAbort.call( xhr );
+ if ( xhr ) {
+ xhr.readyState = 0;
+ }
+ if ( !requestDone ) {
+ complete();
+ }
+ onreadystatechange();
+ };
+ } catch(e) { }
+