Categories

Sep 17, 2019 in React JS

Q:

What is difference between  Synchronous and Asynchronous?

1 Answer

Sep 17, 2019

Synchronous ( async: false ) – Script stops and waits for the server to send back a reply before continuing. There are some situations where Synchronous Ajax is mandatory. In standard Web applications, the interaction between the customer and the server is synchronous. This means that one has to happen after the other. Synchronous part:

$.ajax({    url: "file.php",         type: "POST",         async: false,         success: function(data) {

         }      });

Asynchronous (in Ajax) processes incoming requests in a constant event stack and sends small requests one after the other without waiting for responses. In other words, asynchronous ajax call allow the next line of code to execute, whereas synchronous call stop JavaScript execution until the response from server.

Click here to read more about React JS
Click here to read more about Insurance

Related questions

Madanswer
May 20 in React JS
Jun 19 in React JS
Jun 19 in React JS
...