Last active
December 11, 2015 08:28
-
-
Save dpc/4572888 to your computer and use it in GitHub Desktop.
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
<html><head><title>Prices</title> | |
<script type="text/javascript" src="http://btcrate.com/convert.js?from=eur&to=btc"></script> | |
</head><body> | |
<table> | |
<tr> | |
<td>Beer 1</td><td><span id="eur0"></span></td><td><span id="btc0"></span></td> | |
</tr> | |
<tr> | |
<td>Beer 2</td><td><span id="eur1"></span></td><td><span id="btc1"></span></td> | |
</tr> | |
<tr> | |
<td>Beer 3</td><td><span id="eur2"></span></td><td><span id="btc2"></span></td> | |
</tr> | |
</table> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var prices = [1, 1.3, 2.1]; | |
for (i = 0; i < prices.length; ++i) { | |
var val = prices[i]; | |
document.getElementById("eur" + i.toString()).innerHTML="" + val.toFixed(2) + " EUR"; | |
document.getElementById("btc" + i.toString()).innerHTML="" + (val * btcrate_com_rate).toFixed(3) + " BTC"; | |
} | |
} | |
</script> | |
</body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment