question archive What does it mean for a request to be asynchronous?

What does it mean for a request to be asynchronous?

Subject:Computer SciencePrice:2.89 Bought3

What does it mean for a request to be asynchronous?

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

Asynchronous means that the script will send a request to the server, and continue it's execution without waiting for the reply. As soon as reply is received a browser event is fired, which in turn allows the script to execute associated actions.

Ajax knows when to pull data from server, because you tell it when to do it.

 

Browsers do not give access to threading model, so we have just a single thread to handle the User Interface. So, all the modifications in the application is in the same thread.

Fortunately, the browsers exposes several asynchronous API's, like XHR (XMLHttpRequest) , also known as AJAX. When you register a event handler for some object, the action for this object will be executed in another thread and the browser will trigger the event in the main thread.

So asynchronous mean that the browser won't wait for when the main thread is free to perform the action.

 

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.

Related Questions