The crossorigin attribute, valid on the image, feImage, and 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:
| Keyword | Description |
|---|---|
anonymous |
Client CORS requests for this element will have the credentials flag set to 'same-origin'. |
use-credentials |
Client 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
<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
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
