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

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

    1. <tfoot id='DeOCn'></tfoot>
        <bdo id='DeOCn'></bdo><ul id='DeOCn'></ul>

      <legend id='DeOCn'><style id='DeOCn'><dir id='DeOCn'><q id='DeOCn'></q></dir></style></legend>
    2. 如何在 XMLHttpRequest 中获取响应 url?

      时间:2023-05-16
        <bdo id='MwAH4'></bdo><ul id='MwAH4'></ul>
            1. <tfoot id='MwAH4'></tfoot>
            2. <legend id='MwAH4'><style id='MwAH4'><dir id='MwAH4'><q id='MwAH4'></q></dir></style></legend>

                  <tbody id='MwAH4'></tbody>

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

                <i id='MwAH4'><tr id='MwAH4'><dt id='MwAH4'><q id='MwAH4'><span id='MwAH4'><b id='MwAH4'><form id='MwAH4'><ins id='MwAH4'></ins><ul id='MwAH4'></ul><sub id='MwAH4'></sub></form><legend id='MwAH4'></legend><bdo id='MwAH4'><pre id='MwAH4'><center id='MwAH4'></center></pre></bdo></b><th id='MwAH4'></th></span></q></dt></tr></i><div id='MwAH4'><tfoot id='MwAH4'></tfoot><dl id='MwAH4'><fieldset id='MwAH4'></fieldset></dl></div>
              1. 本文介绍了如何在 XMLHttpRequest 中获取响应 url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                有一个页面(url),我通过 XMLHttpRequest 请求它,但我没有从请求的 url 得到响应,它正在将请求定向到另一个页面,

                There is a page (url), I request it by XMLHttpRequest, but I'm not getting response from requested url, It's directing request to another page,

                请求---> page.php
                从 > directedpage.php

                问题是如何获得响应网址?(以directedpage.php为例)

                and the question is how can I get response url? (directedpage.php in example)

                推荐答案

                在 XMLHttpRequest 实例的 responseurl-attribute">responseURL 属性.此功能是新功能,仅在 2014 年 9 月稳定的 Firefox 32 [ref] 和 Chrome 中受支持37.0.2031.0 2014 年 8 月稳定[ref](可能还有 Opera 24).responseURL 在 IE 11 或 Safari 7 及更早版本的浏览器中(尚)不受支持.对于这些浏览器,之前的答案依然成立:

                The final URL (after following all redirects) is available in the responseURL attribute of a XMLHttpRequest instance. This feature is new and only supported in Firefox 32 stable in September 2014 [ref] and Chrome 37.0.2031.0 stable in August 2014 [ref] (and probably also Opera 24). responseURL is not (yet) supported in IE 11 or Safari 7 and older browsers. For these browsers, the previous answer is still true:

                XMLHttpRequest 自动跟随重定向,而不将提供的 URL 保存在属性中.Location 标头既不能通过 .getResponseHeader() 检索.

                XMLHttpRequest automatically follows redirects, without saving the served URLs in a property. The Location header can neither be retrieved through the .getResponseHeader().

                参考资料:

                • https://groups.google.com/a/chromium.org/d/msg/blink-dev/AU6pAiYZ8J4/ec5jgoEDsF0J
                • https://bugzilla.mozilla.org/show_bug.cgi?id=998076李>

                这篇关于如何在 XMLHttpRequest 中获取响应 url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:WebKit “拒绝设置不安全的标头‘内容长度’" 下一篇:“Access-Control-Allow-Origin 不允许 Origin null"在铬.为什么?

                相关文章

              2. <small id='7Balr'></small><noframes id='7Balr'>

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

                  • <bdo id='7Balr'></bdo><ul id='7Balr'></ul>

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