Skip to content

Instantly share code, notes, and snippets.

@siniusxcode
Created December 18, 2012 05:47
Show Gist options
  • Save siniusxcode/4325380 to your computer and use it in GitHub Desktop.
Save siniusxcode/4325380 to your computer and use it in GitHub Desktop.
blocking request with jQuery.ajax()
$(document).ready(function() {
$('#foo').bind('click', function() {
doSomething();
});
});
var doSomething = function(){
$('#foo').unbind('click');
$.ajax({
type: "POST",
url: "some.do"
}).done(function() {
$('#foo').bind('click', function() {
doSomething();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment