2
我想中止Ajax请求是在其他功能 举例:中止Ajax请求的其他功能
var xhr = false;
$(function(e) {
$(document).on('click', '.menue-button', function(e) {
// Some JS
xhr = $.ajax({
type: "POST",
url: index.php,
//The ajax functions
});
});
});
$(document).on('click', '#progress-abort', function() {
xhr.abort();
});
调试器说:
Uncaught TypeError: Cannot read property 'abort' of undefined
我知道为什么,但我不知道如何解决这个问题
使用trigers .... –