Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / third_party / jstemplate / tutorial_examples / 07-jsdisplay-empty.html
blobd5da9b3e83cb36bbb8954c0fb42e27a1909d7ebe
1 <html>
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">
7 var tplData = {username:"Joe User",
8 addresses:[]};
10 function showData() {
11 // This is the javascript code that processes the template:
12 var input = new JsEvalContext(tplData);
13 var output = document.getElementById('tpl');
14 jstProcess(input, output);
16 </script>
17 </head>
18 <body onload="showData()">
20 <!--
21 This is the template:
22 -->
23 <div id="tpl">
24 <h1>
25 <span jsselect="username" jscontent="$this">User de Fault</span>'s
26 Address Book
27 </h1>
28 <span jsdisplay="addresses.length==0">Address book is empty.</span>
29 <table cellpadding="5" jsdisplay="addresses.length">
30 <tr><td><h2>Location:</h2></td><td><h2>Label:</h2></td></tr>
31 <tr jsselect="addresses"><td jscontent="location"></td><td jscontent="label"></td></tr>
32 </table>
33 </div>
35 </body>
36 </html>