jQuery的AJAX异步:false会导致一个奇怪的警告? [英] jQuery ajax async: false causes a strange warning?

查看:1152
本文介绍了jQuery的AJAX异步:false会导致一个奇怪的警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的JS应用程序,我有很多Ajax与调用异步:假。我公司采用最新的Chrome浏览器,并在下面警告我的控制台最近出现。

  在主线程

同步XMLHtt prequest是德precated因   其有害影响到最终用户的体验。如需更多帮助,   检查 http://xhr.spec.whatwg.org/

现在我试图改变这一切异步:假异步:真正的。但它会导致很多错误,因为我的应用程序需要与运行异步:假

时的警告只是一个错误的东西?我可担心还是忽略?

解决方案
  

时的警告只是一个错误的东西?

没有,这是不是一个错误。同步请求确实去precated,对消息中所陈述的理由。

  

我可以担心或者忽略?

您应该听取的意见,并进行适当的修改,以您的应用程序(当然,它不是那么简单,只是改变异步:假异步:真正的

这也许有助于理解异步操作更好的:

In my JS App, i have many Ajax calls with async: false. I am using latest Chrome browser and in my console below warning appears recently.

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

Now i am trying to change all async: false to async: true. But it causes a lot of error because my app needs to run with async: false.

Is the warning just a bug or something? Can i worry about that or ignore that?

解决方案

Is the warning just a bug or something?

No, it's not a bug. Sync requests are indeed deprecated, for the reasons stated in the message.

Can i worry about that or ignore that?

You should heed the advice and make the appropriate changes to your app (and yes, it's not as simple as just changing async: false to async: true).

Maybe this helps to understand asynchronous operations better:

这篇关于jQuery的AJAX异步:false会导致一个奇怪的警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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