jQuery – Prevent Multiple AJAX Requests

jQuery – Prevent Multiple AJAX Requests

Many times we do not want to take any other requests of the same type while one is still in progress. A normal post request looks something like: [sourcecode language=”javascript”] function doSignup(){ $.post(‘http://my-awsomesite/ajax.php’, $(‘#signupForm’).serialize(), function(resp){ if(resp.status == ‘OK’){ alert("Success message"); }else{ alert("duh! Signup failed"); } }, ‘JSON’); } [/sourcecode] Suppose,...Read more