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

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

Using this code:

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


        
2条回答
  •  爱一瞬间的悲伤
    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.

提交回复
热议问题