Back to Content

crossorigin

files/en-us/web/svg/reference/attribute/crossorigin/index.md

latest1.5 KB
Original Source

The crossorigin attribute, valid on the {{SVGElement("image")}}, {{SVGElement("feImage")}}, and {{SVGElement("script")}} elements, provides support for configuration of Cross-Origin Resource Sharing (CORS) requests for the element's fetched data.

This table shows possible keywords and their meaning:

KeywordDescription
anonymousClient CORS requests for this element will have the credentials flag set to 'same-origin'.
use-credentialsClient CORS requests for this element will have the credentials flag set to 'include'.
""Setting the attribute name to an empty value, like crossorigin or crossorigin="", is the same as anonymous.

It follows the same processing rules as the HTML attribute crossorigin.

Example

html
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
  <image
    href="https://example.com/mdn_logo_dark.png"
    height="200"
    width="200"
    crossorigin="use-credentials" />
</svg>

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also