
Needs to be served by a web server to work. "cd html && python -m SimpleHTTPServer" should do the trick.
11 lines
360 B
JavaScript
11 lines
360 B
JavaScript
// sets variable source to the animalTemplate id in index.html
|
|
var source = document.getElementById("PTGtemplate").innerHTML;
|
|
|
|
// Handlebars compiles the above source into a template
|
|
var template = Handlebars.compile(source);
|
|
|
|
$.getJSON("ptg.json", function(json) {
|
|
console.log(json);
|
|
document.getElementById("PTGsessions").innerHTML = template(json);
|
|
});
|