UNPKG

tabletop

Version:

**Tabletop.js** takes a Google Spreadsheet and makes it easily accessible through JavaScript. With zero dependencies!

29 lines (22 loc) 949 B
<!DOCTYPE html> <html> <body> <p id="data"></p> <script type="text/javascript" src="../../src/tabletop.js"></script> <script type="text/javascript"> var public_spreadsheet_url = 'https://docs.google.com/spreadsheets/d/1sbyMINQHPsJctjAtMW0lCfLrcpMqoGMOJj6AN-sNQrc/pubhtml'; function init() { Tabletop.init( { key: public_spreadsheet_url, callback: showInfo, simpleSheet: true } ); } window.addEventListener('DOMContentLoaded', init) function showInfo(data) { // data comes through as a simple array since simpleSheet is turned on document.getElementById("data").innerHTML = JSON.stringify(data); 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>