2017-01-24 09:57:25 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2017-01-26 07:44:58 +03:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Feather</title>
|
2017-01-24 09:57:25 +03:00
|
|
|
</head>
|
|
|
|
<body>
|
2017-01-26 07:44:58 +03:00
|
|
|
|
|
|
|
<div class="svg-container"></div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
const iconName = 'square';
|
|
|
|
|
|
|
|
fetch(`./icons/${iconName}.svg`)
|
|
|
|
.then(response => response.text())
|
|
|
|
.then(svgText => {
|
|
|
|
const svgDocument = new DOMParser().parseFromString(svgText, 'image/svg+xml');
|
|
|
|
const svgIcon = svgDocument.querySelector('svg').cloneNode(true);
|
|
|
|
const svgContainer = document.querySelector('.svg-container');
|
|
|
|
|
|
|
|
svgContainer.appendChild(svgIcon);
|
|
|
|
});
|
|
|
|
</script>
|
2017-01-24 09:57:25 +03:00
|
|
|
</body>
|
|
|
|
</html>
|