Created
June 10, 2013 15:37
-
-
Save robroc/5749735 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
<script type="text/javascript"> | |
// Assign Google spreadsheet URL to variable | |
var public_spreadsheet_url = 'https://docs.google.com/spreadsheet/pub?key=0ArP8859PKYs8dEpUQ3hLejA1TVo1cWxPbnBVNy11TGc&output=html'; | |
$(document).ready( function() { | |
// Initialize Tabletop with whatever options you want | |
Tabletop.init( { key: public_spreadsheet_url, | |
callback: showInfo, | |
simpleSheet: true | |
}); | |
// Compile Handlebars template | |
function showInfo(data, tabletop) { | |
var source = $("#handlebars-template").html(); | |
var template = Handlebars.compile(source); | |
// Create a templated item for every row in the spreadsheet | |
$.each( tabletop.sheets("profiles").all(), function(i, cat) { | |
var html = template(cat); | |
$("#content").append(html); | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment