Created
March 26, 2021 14:45
-
-
Save ssaurel/8a3fc8379ba6bf01c0999dc2c4719f1d to your computer and use it in GitHub Desktop.
BPI Call For Bitcoin Price in Words
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
function bitcoinPrice() { | |
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