<bdo id='kpjZV'></bdo><ul id='kpjZV'></ul>

    1. <small id='kpjZV'></small><noframes id='kpjZV'>

    2. <tfoot id='kpjZV'></tfoot>
        <legend id='kpjZV'><style id='kpjZV'><dir id='kpjZV'><q id='kpjZV'></q></dir></style></legend>
        <i id='kpjZV'><tr id='kpjZV'><dt id='kpjZV'><q id='kpjZV'><span id='kpjZV'><b id='kpjZV'><form id='kpjZV'><ins id='kpjZV'></ins><ul id='kpjZV'></ul><sub id='kpjZV'></sub></form><legend id='kpjZV'></legend><bdo id='kpjZV'><pre id='kpjZV'><center id='kpjZV'></center></pre></bdo></b><th id='kpjZV'></th></span></q></dt></tr></i><div id='kpjZV'><tfoot id='kpjZV'></tfoot><dl id='kpjZV'><fieldset id='kpjZV'></fieldset></dl></div>
      1. 主线程上的同步 XMLHttpRequest 已被弃用...尝试了许

        时间:2023-10-13

          <bdo id='8zEf5'></bdo><ul id='8zEf5'></ul>
            • <small id='8zEf5'></small><noframes id='8zEf5'>

              <i id='8zEf5'><tr id='8zEf5'><dt id='8zEf5'><q id='8zEf5'><span id='8zEf5'><b id='8zEf5'><form id='8zEf5'><ins id='8zEf5'></ins><ul id='8zEf5'></ul><sub id='8zEf5'></sub></form><legend id='8zEf5'></legend><bdo id='8zEf5'><pre id='8zEf5'><center id='8zEf5'></center></pre></bdo></b><th id='8zEf5'></th></span></q></dt></tr></i><div id='8zEf5'><tfoot id='8zEf5'></tfoot><dl id='8zEf5'><fieldset id='8zEf5'></fieldset></dl></div>
              <tfoot id='8zEf5'></tfoot>

                    <tbody id='8zEf5'></tbody>
                  <legend id='8zEf5'><style id='8zEf5'><dir id='8zEf5'><q id='8zEf5'></q></dir></style></legend>
                  本文介绍了主线程上的同步 XMLHttpRequest 已被弃用...尝试了许多不同的解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我知道这个问题在这里发布了很多次,但我尝试了所有我能找到的关于堆栈溢出的解决方案,但都没有奏效.我只是试图做一个简单的ajax 查询来加载一个div 内的页面.就这么简单:

                  I know this question was posted so many times in here, but I tried all the solutions I could find on stack overflow and none of them worked. I'm just trying to make a simple ajax query to load a page inside a div. Just as simple as:

                  function loadHome(){
                  $('#container').html('<div class="loader"></div>');
                  $.ajax({
                      type: "GET",
                      url: "home.php",
                          success: function(msg){
                              $("#container").html(msg);
                          }
                  });
                  }
                  

                  在控制台日志上我得到了

                  And on the console log I get

                  主线程上的同步 XMLHttpRequest 已被弃用,因为它会对最终用户的体验产生不利影响.如需更多帮助,请查看 http://xhr.spec.whatwg.org/

                  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/

                  除非我重新加载页面,否则我在主页上的一些 javascript 将无法工作.默认情况下,该页面已在 div 中加载 home.php ,但我希望它加载其他页面,然后当我单击主页"时它应该正常加载,并且由于该错误而没有发生.我已经尝试使用async:true",但没有用.我不知道该怎么办.

                  And some of my javascript on the home page will not work unless I reload the page. That page is by default loading home.php inside the div already, but I want it to load other pages and then when I click "home" it should load normally, and that's not happening because of that error. I already tried to use "async: true", didn't work. I don't know what to do.

                  推荐答案

                  你应该使用本地 jquery 然后从 cdn 以及

                  You should use local jquery then from cdn and also

                  为避免此警告,请勿使用:

                  To avoid this warning, do not use:

                  async: false
                  

                  在您的任何 $.ajax() 调用中.这是 XMLHttpRequest 唯一被弃用的功能.

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

                  默认值为 async: true,因此如果您根本不使用此选项,那么如果该功能被真正删除,您的代码应该是安全的(它可能不会——它可能被从标准中删除,但我敢打赌浏览器会继续支持它很多年).

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

                  参考

                  这篇关于主线程上的同步 XMLHttpRequest 已被弃用...尝试了许多不同的解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:更改文件扩展名会影响 SE 排名吗? 下一篇:XMLHttpRequest - SEC7127:CORS 请求的重定向被阻止

                  相关文章

                  最新文章

                    <i id='STwrM'><tr id='STwrM'><dt id='STwrM'><q id='STwrM'><span id='STwrM'><b id='STwrM'><form id='STwrM'><ins id='STwrM'></ins><ul id='STwrM'></ul><sub id='STwrM'></sub></form><legend id='STwrM'></legend><bdo id='STwrM'><pre id='STwrM'><center id='STwrM'></center></pre></bdo></b><th id='STwrM'></th></span></q></dt></tr></i><div id='STwrM'><tfoot id='STwrM'></tfoot><dl id='STwrM'><fieldset id='STwrM'></fieldset></dl></div>
                    <tfoot id='STwrM'></tfoot>
                      <bdo id='STwrM'></bdo><ul id='STwrM'></ul>

                  1. <small id='STwrM'></small><noframes id='STwrM'>

                      <legend id='STwrM'><style id='STwrM'><dir id='STwrM'><q id='STwrM'></q></dir></style></legend>