Ajax Syncro
Ajax is asynchronous by definition, but sometimes you have to wait for the completion of a transaction. How?
$.ajaxSetup({ async: false });
$.post(url, {});
$.ajaxSetup({ async: true });
Simply!!!!
Written by Maria Manenti
Related protips
2 Responses
async: false will halt the browser, especially when using IE (it could freeze the browser until request is done)..
It's a better choice using the ajax request callbacks :-)
over 1 year ago
·
@emiliolalvarez , you're right!
Exactly:
$.ajax({
url:..,
success: function(data) {
//My function
}
});
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ajax
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#