Making a synchronous call is usually a negligent practice, as you effectively execute the request, while losing all the benefits of asynchrony when you can use callbacks to do the same asynchronously.
async:false will call jQuery.ajax() until it returns. In fact, in the pseudo code instead:
function ajax: perform request callback with results
You do it:
function ajax: perform request while (no results) wait return results
This completely blocks the execution of anything else until it ends ... which is pretty terrible. An obvious use case is to launch an element in the waterfall template: task 1 -> task 2 -> task 3 , which can happen.
If you can afford to block your browser, consider using callbacks anyway. They will allow you to keep the rest of your site active and well, when processing material. You can easily do this by setting async:true and providing the callback with the next step. However, you may find yourself in a callback spaghetti and you might want to use the library to manage large operations, if you have any.
A very good candidate for this is welcomed by Node.JS and is called async.js . This is a tool for MapReduce files and implements both waterfall and parallel models.
The moral of the story : async: false can replace 100% of the time with a callback.
source share