new Ajax.Request时在options选项里如果asynchronous:false
那么声明的onSuccess:successmethod, onComplete:completemethod都不起作用了看了下源码发现应该时这句在搞鬼
[code]
if (this.options.asynchronous) {
this.transport.onreadystatechange = this.onStateChange.bind(this);
setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
}
[/code]
如果不设置成异步方式,那么就不会把onComplete的函数bind上,也就不会执行真不知道他们怎么想的,还是这么设置有什么蹊跷?
我把这个if判断注释调了,在ie里以同步方式判断可以回调onComplete,onSuccess,但是firefox还是不行
那么声明的onSuccess:successmethod, onComplete:completemethod都不起作用了看了下源码发现应该时这句在搞鬼
[code]
if (this.options.asynchronous) {
this.transport.onreadystatechange = this.onStateChange.bind(this);
setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
}
[/code]
如果不设置成异步方式,那么就不会把onComplete的函数bind上,也就不会执行真不知道他们怎么想的,还是这么设置有什么蹊跷?
我把这个if判断注释调了,在ie里以同步方式判断可以回调onComplete,onSuccess,但是firefox还是不行