docs.rodeo

MDN Web Docs mirror

HTMLScriptElement: crossOrigin property

{{APIRef("HTML DOM")}} 

The crossOrigin property of the {{domxref("HTMLScriptElement")}}  interface reflects the {{Glossary("CORS", "Cross-Origin Resource Sharing")}}  settings for the script element. For classic scripts from other origins, this controls if full error information will be exposed. For module scripts, it controls the script itself and any script it imports. See CORS settings attributes for details.

Value

A string of a keyword specifying the CORS mode to use when fetching the resource. Possible values are:

If the crossOrigin property is specified with any other value, it is the same as specifying it as the anonymous.

If the crossOrigin property is not specified, the resource is fetched without CORS (the no-cors {{domxref("Request.mode", "mode", "", "nocode")}}  and the same-origin {{domxref("Request.credentials", "credentials", "", "nocode")}}  mode).

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN