Created
April 18, 2013 19:35
-
-
Save colinmegill/5415598 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
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<script type="text/javascript" src="handlebars.js"></script> | |
<script type="text/javascript" src="jquery.js"></script> | |
<!-- this evaluates myContextObject.title --> | |
<script id="entry-template" type="text/x-handlebars-template"> | |
<div>{{title}}</div> | |
</script> | |
<script type="text/javascript"> | |
var myContextObject = { | |
"title": "My Title To Render" | |
}; | |
var source = $("#entry-template").html(); | |
var template = Handlebars.compile(source); | |
var output = template(myContextObject); | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment