Prevent an ajax request firing twice with jQuery code example
Example: Prevent an ajax request firing twice with jQuery
var ajaxLoading = false;
$(document).ready(function() {
$('#ajaxRequestor').click(function(e) {
e.preventDefault();
if(!ajaxLoading) {
ajaxLoading = true;
$('#ajaxContentPlaceholder').load('/path/to/content.html',
function() {
ajaxLoading = false;
}
);
}
});
});