Hi,
I am trying to produce
<div class="page" id="1"></div>
<div class="page" id="2"></div>
using the template
<div class="page"></div>
this can be done with extra div, but in my project i have constraint
of not wrapping in an extra div.
below is the code.
Thanking you in anticipation.
<html>
<head>
<title>PURE Unobtrusive Rendering Engine</title>
<script src="jquery.js"></script>
<script src="pure.js"></script>
</head>
<body>
<!-- HTML template -->
<div class="page"></div>
<script>
var directive = {
'.' : {
'page<-pages' : {
'@id' : function(arg){
return
this.no;
}
}
}
};
var data = {
"pages" : [
{'no' : '1'},
{'no' : '2'}
]
};
$('
div.page').render(data, directive);
</script>
</body>