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

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

    1. 如何在 XMLHttpRequest 中获取响应 url?

      时间:2023-10-15

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

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

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

              1. 本文介绍了如何在 XMLHttpRequest 中获取响应 url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                有一个页面(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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                相关文章

                最新文章

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

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

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

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