…node test (test gives error on multiple cookies)
Setting onreadystatechange to undefined causes an error to pop up in IE8: http://jsbin.com/ulitew/1/edit Setting it to null also seems to create problems in earlier IE's: https://issues.jboss.org/browse/JBSEAM-1271 Since setting it to a no-op is what jQuery does, I assume that this is probably the most browser-compatible technique.
There's a bug in WebKit where if the execution is halted (through a debugger, for example), an xhr object can fire the readystatechange event (with readyState 4) multiple times (apparently, always 3 times). For reference, see: * madrobby/zepto#633 I'm also linking to 2 jsfiddles that illustrate the issue. I was able to reproduce this behavior on Chrome 23 and mobile Safari on iOS 5 (using remote debugging with an iPad) but not on (desktop) Safari 6. Steps to reproduce with first jsfiddle: 1. Open Chrome 2. Allow pop-ups 3. Go to http://jsfiddle.net/MeXvJ/ 4. Close the pop-up 5. You'll get 3 sequential alert boxes Steps to reproduce with second jsfiddle: 1. Open Chrome 2. Open Developer Tools 3. Go to http://jsfiddle.net/44b3P/ 4. Unpause script execution in the debugger 5. You'll get 3 sequential alert boxes Both jQuery and Zepto already do something similar to what I'm proposing. The difference is that they both set the onreadystatechange handler to a no-op function. Not sure why. * jQuery: https://github.com/jquery/jquery/blob/master/src/ajax/xhr.js * Zepto: https://github.com/madrobby/zepto/blob/master/src/ajax.js
Workaround for aparent cache bug IE 9 and IE 10 that breaks JSONP.
…cces function to cleanup timeout and make sure complete is also run.