-
Notifications
You must be signed in to change notification settings - Fork 22.5k
/
index.md
44 lines (31 loc) · 1.63 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: "SVG attribute: crossorigin"
slug: Web/SVG/Attribute/crossorigin
page-type: svg-attribute
browser-compat: svg.elements.image.crossorigin
---
{{SVGRef}}
The crossorigin attribute, valid on the {{SVGElement("image")}} and {{SVGElement("feImage")}} elements, provides support for configuration of the Cross-Origin Resource Sharing ([CORS](/en-US/docs/Web/HTTP/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`](/en-US/docs/Web/HTML/Attributes/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
- [Cross-Origin Resource Sharing (CORS)](/en-US/docs/Web/HTTP/CORS)