Created
May 19, 2014 10:07
-
-
Save dmgarland/50bf6db143ea24b8690b to your computer and use it in GitHub Desktop.
Underscore template example (HTML)
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
<html> | |
<head> | |
<title>Underscore Howto</title> | |
<script type="text/javascript" src="javascripts/jquery-2.1.1.js"></script> | |
<script type="text/javascript" src="javascripts/underscore.js"></script> | |
<script type="text/javascript" src="javascripts/my_amazing_javascript.js"></script> | |
</head> | |
<body> | |
<h1>Underscore / JQuery practice</h1> | |
<div id="foo"> | |
<div id="bar"> | |
<div id="cool_beans"> | |
</div> | |
</div> | |
</div> | |
<script type="text/template" id="animal_template"> | |
<figure> | |
<h3><%= animal.name %></h3> | |
<dl> | |
<dt>Number of Legs</dt> | |
<dd><%= animal.number_of_legs %></dd> | |
</dl> | |
</figure> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment