I have a series of buttons and foreach button I have a seperate .click(function() {
ie
$("#approved").button().click(function() {
$("#waiting_approval").button().click(function() {
$("#department_waiting_approval").button().click(function() {
$("#department").button().click(function() {
I have the setInterval for ajax which refreshes the data in that div. The problem i face is once the user clicks on a different button I would like to stop the current button click ajax call and start the new one.
Hope this makes sense, thanks in advance.
$("#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);
});