summaryrefslogtreecommitdiff
path: root/chromium/third_party/jstemplate/tutorial_examples/01-quick.html
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/jstemplate/tutorial_examples/01-quick.html')
-rw-r--r--chromium/third_party/jstemplate/tutorial_examples/01-quick.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/chromium/third_party/jstemplate/tutorial_examples/01-quick.html b/chromium/third_party/jstemplate/tutorial_examples/01-quick.html
new file mode 100644
index 00000000000..df8c7e5a5b2
--- /dev/null
+++ b/chromium/third_party/jstemplate/tutorial_examples/01-quick.html
@@ -0,0 +1,33 @@
+<html>
+<head><title>Jstemplates: Quick example</title>
+ <script src="../util.js" type="text/javascript"></script>
+ <script src="../jsevalcontext.js" type="text/javascript"></script>
+ <script src="../jstemplate.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ var favdata = {
+ title: 'Favorite Things',
+ favs: ['raindrops', 'whiskers', 'mittens']
+ };
+
+ function showData(data) {
+ // This is the javascript code that processes the template:
+ var input = new JsEvalContext(data);
+ var output = document.getElementById('t1');
+ jstProcess(input, output);
+ }
+ </script>
+</head>
+<body onload="showData(favdata)">
+
+<!--
+This is the template:
+-->
+<div id="t1">
+ <h1 jscontent="title"></h1>
+ <ul><li jscontent="$this" jsselect="favs"></li></ul>
+</div>
+<p>
+<a href="#" onclick="favdata.favs.push('packages');showData(favdata);">Reprocess</a>
+</p>
+</body>
+</html>