Skip to content

Instantly share code, notes, and snippets.

Created December 22, 2019 22:49
What would you like to do?
dynamic fundraising thermometer from google docs / spreadsheet
<script type="text/javascript">
var sheetPublicWebUrl = ""
var req = new XMLHttpRequest();'GET', sheetPublicWebUrl, true);
req.onload = function() {
result = req.responseText;
cur = Number(result.replace(/[^0-9\.-]+/g,""))
document.getElementById("thermometer").innerHTML =
'<img src="'+cur+'&symbol=%24&color=green" />';
<div id="thermometer"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment