Created
May 28, 2019 20:21
-
-
Save cryptobabel/1fb9f3e43bde61f25a863ff1ae9f9fc8 to your computer and use it in GitHub Desktop.
t.html?asset=reee
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
<script> | |
var urlParams = new URLSearchParams(window.location.search); | |
var useasset = (urlParams.get('asset')) ? urlParams.get('asset') : 'A11130160322110527014'; | |
var xhr = new XMLHttpRequest(); | |
xhr.open( 'GET', 'https://xchain.io/api/asset/' + useasset, true ); | |
xhr.onload = function () { | |
var UglyImgHref = window.JSON.parse( xhr.responseText ).description | |
var UglyTrim = UglyImgHref.substr(6, 7); | |
document.getElementById("FPassets").innerHTML = | |
"<img src='https://i.imgur.com/" + UglyTrim + ".gif'><br>" + UglyImgHref.substr(18); | |
}; | |
xhr.onerror = function () { | |
//process error | |
}; | |
xhr.send(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment