Skip to content

Instantly share code, notes, and snippets.

@whoeverest
Created November 15, 2012 13:22
Show Gist options
  • Save whoeverest/4078638 to your computer and use it in GitHub Desktop.
Save whoeverest/4078638 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="jquery-1.8.2.js"></script>
<script src="templating.js"></script>
<script type="text/html" id="packet_tmpl">
<div>
<% for (var key in p) { %>
packet name <%=p[key]%> <br/>
<% } %>
</div>
</script>
<script type="text/javascript">
packets = document.getElementById('packets');
packets.innerHTML = tmpl("packet_tmpl", {p: {'pack1': '1', 'pack2': '2'}})
</script>
</head>
<body>
<div id="packets"/>
</body>
</html>​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment