redirect 只读特性在 Request interface contains the mode for how redirects are handled.

句法

var myRedirect = request.redirect;
					

A RequestRedirect enum value, which can be one the following strings:

  • follow
  • error
  • manual

If not specified when the request is created, it takes the default value of follow .

范例

In the following snippet, we create a new request using the Request.Request() constructor (for an image file in the same directory as the script), then save the request redirect value in a variable:

var myRequest = new Request('flowers.jpg');
var myCred = myRequest.redirect;
					

规范

规范 状态 注释
Fetch
The definition of 'redirect' in that specification.
实时标准 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
redirect Chrome 46 Edge 14 Firefox Yes IE No Opera Yes Safari No WebView Android No Chrome Android 46 Firefox Android Yes Opera Android Yes Safari iOS No Samsung Internet Android 5.0

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

另请参阅

元数据

  • 最后修改: