A Pen by Blake Bowen on CodePen.
Created
November 27, 2020 01:27
-
-
Save saviorand/4b6d5c6e254a6fa010b05e78b041dcb0 to your computer and use it in GitHub Desktop.
Load SVG Using Fetch API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch("https://s3-us-west-2.amazonaws.com/s.cdpn.io/106114/tiger.svg") | |
.then(response => response.text()) | |
.then(svg => document.body.insertAdjacentHTML("afterbegin", svg)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment