crossorigin
crossorigin 屬性,適用於 <image> 和 <feImage> 元素,支援對元素獲取的資料進行跨域資源共享 (CORS) 請求的配置。
下表顯示了可能的關鍵字及其含義
| 關鍵字 | 描述 |
|---|---|
anonymous |
此元素的客戶端 CORS 請求會將憑證標誌設定為 'same-origin'。 |
use-credentials |
此元素的客戶端 CORS 請求會將憑證標誌設定為 'include'。 |
"" |
將屬性名設定為一個空值,例如 crossorigin 或 crossorigin="",與 anonymous 相同。 |
它遵循與 HTML 屬性 crossorigin 相同的處理規則。
示例
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>
規範
| 規範 |
|---|
| 濾鏡效果模組第 1 級 # element-attrdef-feimage-crossorigin |
| Scalable Vector Graphics (SVG) 2 # ImageElementCrossoriginAttribute |
瀏覽器相容性
svg.elements.feImage.crossorigin
載入中…
svg.elements.image.crossorigin
載入中…