Synchronous XMLHttpRequest is depreciated

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

The purpose of a synchronous XMLHttpRequest ( sxhr ) is it's depreciation that chrome claims. sxhr 's solve problems that otherwise can not be solved using asynchronous calls. Example, the need of a return of a variable outside a asynchronous function. Asynchronous and synchronous methods are entirely different, in fact, they are opposite; So, claiming a method is depreciated by an opposite method is entirely irrational.

I would like to ignore this warning in my framework.

synchronous calls should only be called when necessary, my situation is necessary.


According to the current XHR spec (see yellow note), Chrome is not at fault. Synchronous XHRs are in the process of deprecation on the web platform scale, so you should definitely migrate your application to async XHRs.

链接地址: http://www.djcxy.com/p/55340.html

上一篇: 当“异步”选项为真时,使XMLHttpRequest同步?

下一篇: 同步XMLHttpRequest已折旧