-
-
Save anonymous/b25979fba983946384ca to your computer and use it in GitHub Desktop.
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
var svgText = '<...>'; // SVG source XML | |
// New browsers: Blob URL | |
var svgBlob = new Blob([svgText], {type : 'image/svg+xml'}); | |
myImage.src = URL.createObjectURL(svgBlob); | |
// Older browsers: Data URL (smaller size limit) | |
var dataUrl = 'data:image/svg+xml,' + encodeURI(svgText); | |
myImage.src = dataUrl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment