Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Created December 12, 2017 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaurel/438236cf469dab7651dc6e6b6277039e to your computer and use it in GitHub Desktop.
Save ssaurel/438236cf469dab7651dc6e6b6277039e to your computer and use it in GitHub Desktop.
Bitcoin Price Index Watcher in HTML5 Tutorial Step 2
var xmlhttp = new XMLHttpRequest();
var url = "https://api.coindesk.com/v1/bpi/currentprice.json";
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var json = JSON.parse(this.responseText);
parseJson(json);
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment