Permalink
Browse files

work around Chrome bug where Ajax callback fires more than once

The bug is present in Chrome 23.0.1271.64 and possibly iOS 6, and is
reproducible using the debugger but otherwise occurs randomly.

References #633

http://code.google.com/p/chromium/issues/detail?id=159827
  • Loading branch information...
1 parent 228337f commit 8e84f2e52a007b0f1fea740c49d5e669adc3a3dc @jsnuggle jsnuggle committed with mislav Nov 6, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/ajax.js
View
@@ -195,6 +195,7 @@
xhr.onreadystatechange = function(){
if (xhr.readyState == 4) {
+ xhr.onreadystatechange = empty;
clearTimeout(abortTimeout)
var result, error = false
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {

1 comment on commit 8e84f2e

@JacksonTian

This issue break me one hour. Thanks.

Please sign in to comment.