Request: mode property - Web APIs | MDN (original) (raw)
Value
One of the following values:
Disallows cross-origin requests. If a request is made to another origin with this mode set, the result is an error.
Disables CORS for cross-origin requests. The response is opaque, meaning that its headers and body are not available to JavaScript.
If the request is cross-origin then it will use the Cross-Origin Resource Sharing (CORS) mechanism.
A mode for supporting navigation. The navigate value is intended to be used only by HTML navigation. A navigate request is created only while navigating between documents.
Default mode
Requests can be initiated in a variety of ways, and the mode for a request depends on the particular means by which it was initiated.
For example, when a Request object is created using theRequest() constructor, the value of the mode property for that Request is set to cors.
However, for requests created other than by the Request()constructor, no-cors is typically used as the mode; for example, for embedded resources where the request is initiated from markup, unless thecrossoriginattribute is present, the request is in most cases made using the no-corsmode — that is, for the or