Skip to content Skip to sidebar Skip to footer

What Is The Difference Between A Synchronous And An Asynchronous Request? (async=true/false)

What is the difference between async=false and async=true, when I am using open method of XMLHttpRequest? function GetXML() { if (window.XMLHttpRequest) {// code for IE7+, Fir

Solution 1:

Mozilla Developer: Synchronous and Asynchronous Requests

XMLHttpRequest supports both synchronous and asynchronous communications. In general, however, asynchronous requests should be preferred to synchronous requests for performance reasons.

In short, synchronous requests block the execution of code and can leak memory and events. This can cause serious issues. The only viable reason to use synchronous requests is to more easily facilitate downloads within Web Workers.

Post a Comment for "What Is The Difference Between A Synchronous And An Asynchronous Request? (async=true/false)"