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
发布评论