Synchronous XMLHttpRequest has been deprecated

Published: | Categories: DOM

Description

The async argument of the XMLHttpRequest constructor is true by default, and false makes the request synchronous. Developers now get an warning in the Web Console if a synchronous request is used on the main thread, or the outside of workers, since it’s now considered deprecated due to the negative effects to the user experience.

Possible solutions: using synchronous requests in a Worker, or using asynchronous requests in a Promise.

References