Created
December 12, 2017 10:46
-
-
Save ssaurel/438236cf469dab7651dc6e6b6277039e to your computer and use it in GitHub Desktop.
Bitcoin Price Index Watcher in HTML5 Tutorial Step 2
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
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