主线程上的同步 XMLHttpRequest 已弃用 [英] Synchronous XMLHttpRequest on the main thread is deprecated

查看:44
本文介绍了主线程上的同步 XMLHttpRequest 已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么这个消息突然开始出现在 Firefox 控制台中?

Why has this message suddenly started to appear in the Firefox console?

我使用的是 JQuery 1.7.1.

I'm using JQuery 1.7.1.

我可以在我的应用中做什么导致此消息开始出现?

What in my app could I be doing that has caused this message to start appearing?

推荐答案

使用 jQuery 将脚本标签附加到文档将导致它使用 async:false 加载脚本并触发此警告.

Using jQuery to append a script tag to the document will cause it to load the script with async:false and trigger this warning.

如:

var script = $("<script></script>");
script.attr("src", player.basepath + "whatever.js");
$(document.body).append(script);

这篇关于主线程上的同步 XMLHttpRequest 已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆