Skip to content

Instantly share code, notes, and snippets.

@hbi99
Last active December 31, 2015 20:09
Show Gist options
  • Save hbi99/8038191 to your computer and use it in GitHub Desktop.
Save hbi99/8038191 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Defiant.js</title>
<script type="text/javascript" src="/res/js/defiant.js"></script>
</head>
<body>
<!-- output element -->
<div id="output"></div>
<script type="text/javascript">
var data = { "store": {
"book": [{ "title": "The Lord of the Rings",
"author": "J. R. R. Tolkien",
"category": "Fiction",
"price": 22.99,
},
{ "title": "Moby Dick",
"author": "Herman Melville",
"category": "Fiction",
"price": 8.99
}]
}
},
htm = Defiant.render('books_template', data);
document.getElementById('output').innerHTML = htm;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment