HTML - crossorigin attribute (CORS policy)

About

crossorigin is an attribute that set the mode of the request to an HTTP CORS Request.

Its value defines further the CORS policy.

It can be used on every html elements that fetch resources from a cross-origin Url.

Example

With the script element

<script 
   src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" 
   integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" 
   crossorigin="anonymous" 
   defer="true">
</script>

where:

Syntax

<tag crossorigin=value/>

where:

If the attribute is missing, the CORS request has the No CORS mode.

1)

Documentation





Discover More
Chrome Devtool Xhr Fetch Request
Browser - Web API - Fetch function

The fetch function is part of the web api function and is a AJAX call. It's one of the possibilities to fetch a resource. XMLHttpRequest (XHR) The fetch function returns a promise as response. The Fetch...
HTML - The link element (inter-document relationships)

The link represents metadata that expresses inter-document relationships. hyperlink The link element can be used only within the head element. where: media is a list of media query separated...
HTTP - Cross-Origin Request

A cross-origin request is a request that was not created by code (html page, javascript, ...)) of the same origin. cross site requestsame origin requestcross-originsame origin A page may contain images...
What are the HTML elements that fetch resources?

Some HTML elements are fetching resources. This page lists them.
What is the script HTML element?

A client-side script is a program that is: linked (server-side script) or directly embedded in an HTML document (in-line script) Scripts in HTML have “run-to-completion” semantics, meaning that...



Share this page:
Follow us:
Task Runner