How to you abort/cancel a request using the prototype js library?

后端 未结 2 481
逝去的感伤
逝去的感伤 2020-12-15 22:11

Using this code:

var pendingRequest =  new Ajax.Request(myUrl, {
               method: \'post\',
               postBody: soapMsg,
               contentTyp         


        
相关标签:
2条回答
  • 2020-12-15 22:39

    I reccomend this article: http://blog.pothoven.net/2007/12/aborting-ajax-requests-for-prototypejs.html works for me.

    0 讨论(0)
  • 2020-12-15 22:49

    You can use XHR's abort.

    The XHR-object is stored in pendingRequest.transport, so using

    pendingRequest.transport.abort()
    

    would cancel the request.

    0 讨论(0)
提交回复
热议问题