Skip to content

Instantly share code, notes, and snippets.

@ssaurel

ssaurel/bpi_call.js

Created Dec 12, 2017
Embed
What would you like to do?
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