Ajax.html:35 [Deprecation] 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

时间:2021-02-02 21:43:48

AJAX的容易错误的地方

Ajax.html:35 [Deprecation] 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/.
Ajax @ Ajax.html:35
(anonymous) @ Ajax.html:58

在chrome控制台是这样的

Ajax.html:35 [Deprecation] 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

这个错误是来自xhr.open(“get”,url,true);是来自这句代码  第三个参数是异步或者同步的  如果你来自参数 不小心传递成了字符串 就这样了

xhr.open("get",url,"true");就会是这个结果 不信你们去试试