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

    <tfoot id='txRIY'></tfoot>

    <small id='txRIY'></small><noframes id='txRIY'>

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

      <legend id='txRIY'><style id='txRIY'><dir id='txRIY'><q id='txRIY'></q></dir></style></legend>
      1. 突然设置 XMLHttpRequest.responseType 被禁止?

        时间:2023-10-14
        <legend id='7hYEE'><style id='7hYEE'><dir id='7hYEE'><q id='7hYEE'></q></dir></style></legend>
      2. <i id='7hYEE'><tr id='7hYEE'><dt id='7hYEE'><q id='7hYEE'><span id='7hYEE'><b id='7hYEE'><form id='7hYEE'><ins id='7hYEE'></ins><ul id='7hYEE'></ul><sub id='7hYEE'></sub></form><legend id='7hYEE'></legend><bdo id='7hYEE'><pre id='7hYEE'><center id='7hYEE'></center></pre></bdo></b><th id='7hYEE'></th></span></q></dt></tr></i><div id='7hYEE'><tfoot id='7hYEE'></tfoot><dl id='7hYEE'><fieldset id='7hYEE'></fieldset></dl></div>

        <tfoot id='7hYEE'></tfoot>

              <small id='7hYEE'></small><noframes id='7hYEE'>

                <tbody id='7hYEE'></tbody>

                • <bdo id='7hYEE'></bdo><ul id='7hYEE'></ul>
                  本文介绍了突然设置 XMLHttpRequest.responseType 被禁止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我一直在使用同步 XMLHttpRequest 并将 responseType 设置为arraybuffer"来加载二进制文件并等待它加载.今天,我收到了这个错误:Die Verwendung des responseType-Attributes von XMLHttpRequest wird im synchronen Modus im window-Kontekt nicht mehr unterstützt."大致翻译为不再支持在 window-context(?) 中以同步模式对 XMLHttpRequest 使用 responseType."

                  I've been using synchronous XMLHttpRequest with responseType set to "arraybuffer" for quite a while to load a binary file and wait until it is loaded. Today, I got this error: "Die Verwendung des responseType-Attributes von XMLHttpRequest wird im synchronen Modus im window-Kontekt nicht mehr unterstützt." which roughly translates to "Usage of responseType for XMLHttpRequest in synchronous mode in window-context(?) no longer supported."

                  有谁知道如何解决这个问题?我真的不想对这样的事情使用异步请求.

                  Does anyone know how to fix this? I realy don't want to use an asynchronous request for something like this.

                  var xhr = new XMLHttpRequest();
                  xhr.open('GET', url, false);
                  xhr.responseType = 'arraybuffer';
                  

                  在 chrome 中运行良好.

                  Works fine in chrome.

                  推荐答案

                  这是正确的行为,如 XMLHttpRequest的规范:

                  This is correct behaviour, as defined in the Specification of XMLHttpRequest:

                  设置时:抛出 "InvalidAccessError" 异常,如果 同步flag 已设置,并且有一个关联的 XMLHttpRequest 文档.

                  When set: throws an "InvalidAccessError" exception if the synchronous flag is set and there is an associated XMLHttpRequest document.

                  XMLHttpRequest非异步即同步时,不能设置responseType属性.将open的第三个参数设置为false会导致请求同步.

                  The responseType property cannot be set when the XMLHttpRequest is not async, that is, synchronous. Setting the third parameter of open to false causes the request to be synchronous.

                  这篇关于突然设置 XMLHttpRequest.responseType 被禁止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Phantom JS 同步 AJAX 请求:NETWORK_ERR: XMLHttpRequest Exc 下一篇:使用 XMLHttpRequest 提示文件下载

                  相关文章

                  最新文章

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

                    <tfoot id='gIiWd'></tfoot>
                  2. <legend id='gIiWd'><style id='gIiWd'><dir id='gIiWd'><q id='gIiWd'></q></dir></style></legend>

                    <small id='gIiWd'></small><noframes id='gIiWd'>

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