Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (28 sloc) 0.759 kB
<html>
<head>
<title>Jade</title>
<script src="../jade.js"></script>
<script>
onload = function(){
var html = document.getElementById('pet-template').innerHTML;
var fn = jade.compile(html);
var locals = { pet: { name: 'Tobi', species: 'Ferret', age: 2, siblings: ['Loki', 'Jane'] }};
var html = fn(locals);
document.getElementById('pets').innerHTML = html;
};
</script>
</head>
<body>
<table id="pets"></table>
<script id="pet-template" type="text/template">
tbody
tr.pet
td.name= pet.name
td.description is a #{pet.age} year old #{pet.species}
td.siblings and has sibling(s)
ul
each sibling in pet.siblings
li= sibling
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.