Created
December 12, 2017 10:52
-
-
Save ssaurel/0fd2227e99fea8fb8bbe67aabdd0095b to your computer and use it in GitHub Desktop.
Bitcoin Price Index Watcher in HTML5 Tutorial Step 3
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 parseJson(json) { | |
var time = "<b>Last Updated : " + json["time"]["updated"] + "</b>"; | |
var usdValue = "1 BTC equals to $" + json["bpi"]["USD"]["rate"]; | |
var gbpValue = "1 BTC equals to £" + json["bpi"]["GBP"]["rate"]; | |
var euroValue = "1 BTC equals to €" + json["bpi"]["EUR"]["rate"]; | |
document.getElementById("data").innerHTML = | |
time + "<br /><br />" + usdValue + "<br />" + gbpValue + "<br />" + euroValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment