Created
October 10, 2023 12:51
-
-
Save bjoerntx/347f4c02dcfb7f0890baef422bae0e9b 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
// ajax call to get the svg with glyphs | |
$.ajax({ | |
url: '@Url.Action("GetSVG", "Home")', | |
type: 'GET', | |
dataType: 'json', | |
success: function (data) { | |
console.log(atob(data[0])); | |
// for each element in data array | |
$.each(data, function (index, value) { | |
// create img element | |
var img = document.createElement('img'); | |
img.className = 'svgImage'; | |
img.src = 'data:image/svg+xml;base64,' + value; | |
img.width = 200; | |
// append to container | |
$('#imageContainer').append(img); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment