blob: 3de069c8d15c7a95f8c25d8c364287b7033a3730 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
<title><use> with a cross-origin resource</title>
<h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute"/>
<h:link rel="match" href="reference/green-100x100.svg"/>
<rect width="100" height="100" fill="green"/>
<script>
const svg = document.querySelector('svg');
const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');
use.setAttribute('href', location.href.replace('://', '://www1.') + '/../support/red-rect.svg#red-rect');
svg.appendChild(use);
</script>
</svg>
|