OK, So I am creating a entire web app using AJAX with some local storage etc.
The issue I am having is sometimes I double click, or click tabs back and forth quickly which invoke a $.post call.
Problem lies when the callbacks are fired, they are called back and keep overwritting eachother until the last call has came back.
Obviously that is a problem. What I need to do is cancel current POST calls and just get the last callback.
I have tried:
// Make Call:
if(call != undefined){
call.abort();
}
var call = $.post(url,{do:'stuff'},function(response){
// callback stuff:
},'json');
Keeps saying its undefined regardless, I rather use .POST than .AJAX if possible.
Thanks for your help in advance!
Simply unbind the click event on click, re-bind it on callback.