image
alpha

代码写的好,bug改到老

免责声明:网站内容仅供个人学习记录,禁做商业用途,转载请注明出处。

版权所有 © 2017-2020 NEUSNCP个人学习笔记 辽ICP备17017855号-2

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. 警告解决方案

alpha    2020年2月16日 18:56:12

        有时候,浏览器加载网站,在控制台会出现 jquery.min.js:4 [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/. 的警告,原因是在某个js 脚本中,又额外动态引用了其他 js 文件。因为 ajax 的请求通常是异步的,如果需要在 js 里使用 ajax 同步加载 js 资源,就会出现上述警告。

        解决方案:查找 js 脚本引用其他位置 js 文件的代码,删除掉,并将库文件直接以静态资源方式加入到文件的脚本声明中。例如:
<script type="text/javascript" src="/static/js/member/bootstrap.min.js"></script>
        这样就可以去除警告提示了。
 
最近更新: 2020年2月16日 19:02:21
浏览: 2.9K

[[total]] 条评论

添加评论
  1. [[item.time]]
    [[item.user.username]] [[item.floor]]楼
  2. 点击加载更多……
  3. 添加评论