I am trying to create JSON template using JS here is my code.For some reason it doesn't display any result.Can some one please check what is the issue
<html>
<head>
<script type="text/javascript"src=""http://jsontemplate.googlecode.com/svn/trunk/javascript/json-template.js"">
</script>
<script type="text/javascript">
function write() {
var t = jsontemplate.Template("{# This is a comment and will be removed from the output.}\n\n{.section products}\n <h2>Products for Dove</h2>\n\n <table width=\"100%\">\n {.repeated section products}\n <tr><td>{Product Name}</td>\n</tr>\n {.end}\n </table>\n{.or}\n <p><em>(No page content matches)</em></p>\n{.end}\n");
var s = t.expand({
"products": [{
"Product Name": "dove moisturiser"
},
{
"Product Name": "Deodrant"
}]
});
document.getElementById("replace").innerHTML = s;
}
</script>
</head>
<body onload="write();">
<h4>This is for test.</h4>
<div id="replace"></div>
</body>
</html>