在主线程同步XMLHtt prequest是德precated [英] Synchronous XMLHttpRequest on the main thread is deprecated

查看:193
本文介绍了在主线程同步XMLHtt prequest是德precated的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么这条消息突然开始出现在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添加一个script标签的文件将导致它与异步加载脚本:误,并触发此警告

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);

这篇关于在主线程同步XMLHtt prequest是德precated的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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