Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cryptobabel/1fb9f3e43bde61f25a863ff1ae9f9fc8 to your computer and use it in GitHub Desktop.
Save cryptobabel/1fb9f3e43bde61f25a863ff1ae9f9fc8 to your computer and use it in GitHub Desktop.
t.html?asset=reee
<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