2 <head><title>Jstemplates: Quick example
</title>
3 <script src=
"../util.js" type=
"text/javascript"></script>
4 <script src=
"../jsevalcontext.js" type=
"text/javascript"></script>
5 <script src=
"../jstemplate.js" type=
"text/javascript"></script>
6 <script type=
"text/javascript">
8 title
: 'Favorite Things',
9 favs
: ['raindrops', 'whiskers', 'mittens']
12 function showData(data
) {
13 // This is the javascript code that processes the template:
14 var input
= new JsEvalContext(data
);
15 var output
= document
.getElementById('t1');
16 jstProcess(input
, output
);
20 <body onload=
"showData(favdata)">
26 <h1 jscontent=
"title"></h1>
27 <ul><li jscontent=
"$this" jsselect=
"favs"></li></ul>
30 <a href=
"#" onclick=
"favdata.favs.push('packages');showData(favdata);">Reprocess
</a>