Aborting a jQuery getJSON XMLHttpRequest

后端 未结 4 567
梦毁少年i
梦毁少年i 2020-12-29 10:25

Turns out this was an artefact of a Firebug bug. The Ajax request was cancelled, but Firebug continued reporting it as active. Details here.


I have long runnin

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 11:09

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

    i do not think it cancels the request itself, it just ignores any response (manipulating the event handler)- but i didnt really try it out yet.

    but it will deifnitely allow you to reuse the object - no matter if the browser still has some thread working with the old request.

提交回复
热议问题