万恶的jquery abort bug
来源:岁月联盟
编辑:exp
时间:2012-03-22
在这之前有介绍过jquery1.4.1的jquery abort bug,见:http://www.2cto.com/kf/201203/124315.html
,就是说在IE7下无法执行请求的abort操作。
没想到1.4.3版本了还是没有修复!
他的注解更可恶:
1. // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
2. // Opera doesn't fire onreadystatechange at all on abort
3. try {
4. var oldAbort = xhr.abort;
5. xhr.abort = function () {
6. // xhr.abort in IE7 is not a native JS function
7. // and does not have a call property
8. if (xhr && oldAbort.call) {
9. oldAbort.call(xhr);
10. }
11.
12. onreadystatechange("abort");
13. };
14. } catch (abortError) { }
修复方法同之前:有需要可查看:http://www.2cto.com/kf/201203/124315.html
摘自 JsLover