Search code examples
jqueryasynchronouspostgetasp.net-ajax

AJAX .post async


What exactly does the following do:

$.ajax({
     type: "POST",
     async: false,

vs

$.ajax({
    type: "POST",
    async: true,

Meaning what is the difference in the behavior?


Solution

  • From the jQuery site:

    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. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active.

    That's all there is to it. If you need help on a specific problem let me know.