twitter twitter - 2 months ago 7
Ajax Question

in .ajax calls, is async: true assumed by default?

Some of the code I've seen specifies

async:true
and other code
async:false
. If I don't declare
async
at all, does it default to
true
, so ajax calls are by default asynchronous?

Answer

Looking at the documentation of jQuery.ajax (quoting) :

By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false.