zoukankan      html  css  js  c++  java
  • jquery has deprecated synchronous XMLHTTPRequest

    Like many others, my website is using jquery. When I open the developer tools, I see a warning that says that XMLHTTPRequest is

    deprecated because of its detrimental effects to the end user's experience.

    I went on and read part of the documentation, but it was fairly technical. Can someone explain the consequences of shifting from XMLHTTPRequest to WHATWG in simple terms? It says it happened in 2012. Also, the documentation says that Synchronous XMLHttpRequest outside of workers is in the process of being removed from the web platform, when that happens, if a user agent had them in a service, do they need to modify their existing code?

    To avoid this warning, do not use:

    async: false

    in any of your $.ajax() calls. This is the only feature of XMLHttpRequest that's deprecated.

    The default is async: true, so if you never use this option at all, your code should be safe if the feature is ever really removed (it probably won't be -- it may be removed from the standards, but I'll bet browsers will continue to support it for many years).

    This is jQuery's warning then. I can ignore it? I don't use synchronous calls to the server. The perfectionist side of me doesn't like having warnings at all. – Jordan Feb 20 at 19:48
        
    @Jordan I think the warning is coming from the browser, not jQuery. It will happen whenever you try to use synchronous AJAX. If you use jQuery, that will only happen if you specify that option to $.ajax. – BarmarFeb 20 at 21:47
  • 相关阅读:
    集成mybatis(五)
    集成mybatis(四)
    集成mybatis(三)
    集成mybatis(二)
    集成mybatis(一)
    动态代理深入研究
    ==和equals的区别
    ajax写法
    springMVC通过ajax传参到后台
    记录一次 sql在数据库可以查到 mybatis代码查不到的问题
  • 原文地址:https://www.cnblogs.com/oxspirt/p/4979877.html
Copyright © 2011-2022 走看看