Skip to content

Instantly share code, notes, and snippets.

@saviorand
Created November 27, 2020 01:27
Show Gist options
  • Save saviorand/4b6d5c6e254a6fa010b05e78b041dcb0 to your computer and use it in GitHub Desktop.
Save saviorand/4b6d5c6e254a6fa010b05e78b041dcb0 to your computer and use it in GitHub Desktop.
Load SVG Using Fetch API
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