📜  jquery 在点击时取消 ajax 请求 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:02.283000             🧑  作者: Mango

代码示例1
var xhr = $.ajax({
    type: "POST",
    url: "some.php",
    data: "name=John&location=Boston",
    success: function(msg){
       alert( "Data Saved: " + msg );
    }
});

//kill the request
xhr.abort()