只读
XMLHttpRequest.responseURL
property returns the serialized URL of the response or the empty string if the URL is
null
. If the URL is returned, any URL fragment present in the URL will be stripped away. The value of
responseURL
will be the final URL obtained after any redirects.
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://example.com/test', true);
xhr.onload = function () {
console.log(xhr.responseURL); // http://example.com/test
};
xhr.send(null);
| 规范 | 状态 | 注释 |
|---|---|---|
| XMLHttpRequest | 实时标准 | WHATWG (Web 超文本应用程序技术工作组) 实时标准 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
responseURL
|
Chrome 37 | Edge 14 | Firefox 32 | IE No | Opera 24 | Safari 8 | WebView Android 37 | Chrome Android 37 | Firefox Android 32 | Opera Android 24 | Safari iOS Yes | Samsung Internet Android 3.0 |
完整支持
不支持
XMLHttpRequest