cancel or abort ajax call in ie 6,7,8

2019-08-02 13:25发布

how can i cancel a simple js ajax call while its being performed?

1条回答
Explosion°爆炸
2楼-- · 2019-08-02 14:15

normally with ajax.abort(); but on IE it wont really quit requesting:

Calling abort resets the object; the onreadystatechange event handler is removed, and readyState is changed to 0 (uninitialized).

the quote is from the Microsoft javascript docu. From this I guess it highly depends on the browser implementation what exactly is going on. most browser will probably try to finish gracefully - thus the connections might still be up for some time until finally closed - but thats just a guess.

(see also Aborting a jQuery getJSON XMLHttpRequest )

查看更多
登录 后发表回答