This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Promises example, plus removing nsp for npm audit success
- Loading branch information
Showing
3 changed files
with
593 additions
and
690 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
|
||
<p id="food"></p> | ||
|
||
<script type="text/javascript" src="../../src/tabletop.js"></script> | ||
<script type="text/javascript"> | ||
var public_spreadsheet_url = 'https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AmYzu_s7QHsmdDNZUzRlYldnWTZCLXdrMXlYQzVxSFE&output=html'; | ||
|
||
function init() { | ||
Tabletop.init( { | ||
key: public_spreadsheet_url, | ||
simpleSheet: true | ||
}) | ||
.then(showInfo) | ||
} | ||
|
||
window.addEventListener('DOMContentLoaded', init) | ||
|
||
function showInfo(data) { | ||
// data comes through as a simple array since simpleSheet is turned on | ||
alert("Successfully processed " + data.length + " rows!") | ||
document.getElementById("food").innerHTML = "<strong>Foods:</strong> " + [ data[0].Name, data[1].Name, data[2].Name ].join(", "); | ||
console.log(data); | ||
} | ||
|
||
document.write("The published spreadsheet is located at <a target='_new' href='" + public_spreadsheet_url + "'>" + public_spreadsheet_url + "</a>"); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.