我有一系列按钮和foreach按钮的我有一个单独的。点击(函数(){取消的setInterval为按钮点击AJAX
即
$("#approved").button().click(function() {
$("#waiting_approval").button().click(function() {
$("#department_waiting_approval").button().click(function() {
$("#department").button().click(function() {
我有对的setInterval AJAX该刷新在该div中的数据 我面临的问题是,一旦用户点击不同的按钮,我想停止当前按钮单击阿贾克斯呼叫,并开始新的一个
希望这是有道理的,在此先感谢。
$("#approved").button().click(function() {
setInterval(function(){
$.ajax({
type: "GET",
url: "holidays/academic_days.php?userid='+$('#approved_list').attr('class')",
dataType: "html",
success: function(data) {
jQuery("#approved_list").fadeOut(10 , function() {
jQuery(this).html(data);
$('#approved_list').show();
$('#waiting_approval_list').hide();
$('#department_waiting_approval_list').hide();
$('#department_logs').hide();
}).fadeIn(100);
}
})
}, 100);
});
http://stackoverflow.com/questions/446594/abort-ajax-requests-using-jquery –