开发者

How to get xhr object from $.load function?

开发者 https://www.devze.com 2023-01-14 16:49 出处:网络
A user click a button that makes a request and then click aga开发者_如何学Pythonin and again and again...

A user click a button that makes a request and then click aga开发者_如何学Pythonin and again and again...

I wanted to use xhr.abort(), but I don't know if I can retrieve it from $.load.

Is it possible?


If you want it for an abort, you should perhaps use $.get() instead.

var xhr = $.get('url', function(response) {
    $('#myElement').append( response );
});

xhr.abort();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号