Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to th

编程入门 行业动态 更新时间:2024-10-10 23:26:55

Synchronous XMLHttpRequest on the <a href=https://www.elefans.com/category/jswz/34/1760931.html style=main thread is deprecated because of its detrimental effects to th"/>

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to th

这个警告并不是错误,不是逻辑和代码错误,而是浏览器检测出来的一种不建议写法和用法的一种警示,完全不影响程序的执行和正常运行。

翻译:XMLHttpRequest 发送ajax请求,运行在浏览器的主线程,而且是同步的,这样会引起不好的用户体难,可能导制浏览器卡死等等。

 

解决方法:

1.将<script src="/scripts/script.js"></script>提前写入前台页面,从发送过来的HTML代码段剥离出去。

 

2.将引用的外部js脚本文件,写到dom里面。

 

最后欢迎大家访问我的个人网站:1024s

更多推荐

Synchronous XMLHttpRequest on the main thread is deprecated because of its detri

本文发布于:2024-02-06 12:19:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1748885.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:main   XMLHttpRequest   Synchronous   thread   effects

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!