index.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE HTML>
  2. <!--
  3. /*
  4. * JavaScript Templates Demo
  5. * https://github.com/blueimp/JavaScript-Templates
  6. *
  7. * Copyright 2011, Sebastian Tschan
  8. * https://blueimp.net
  9. *
  10. * Licensed under the MIT license:
  11. * http://www.opensource.org/licenses/MIT
  12. */
  13. -->
  14. <html lang="en">
  15. <head>
  16. <!--[if IE]>
  17. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  18. <![endif]-->
  19. <meta charset="utf-8">
  20. <title>JavaScript Templates Demo</title>
  21. <meta name="description" content="1KB lightweight, fast &amp; powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.">
  22. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  23. <link rel="stylesheet" href="css/demo.css">
  24. </head>
  25. <body>
  26. <h1>JavaScript Templates Demo</h1>
  27. <p><strong>1KB</strong> lightweight, fast &amp; powerful <a href="https://developer.mozilla.org/en/JavaScript/">JavaScript</a> templating engine with zero dependencies.<br>
  28. Compatible with server-side environments like <a href="http://nodejs.org/">Node.js</a>, module loaders like <a href="http://requirejs.org/">RequireJS</a>, <a href="http://browserify.org/">Browserify</a> or <a href="https://webpack.github.io/">webpack</a> and all web browsers.</p>
  29. <ul class="navigation">
  30. <li><a href="https://github.com/blueimp/JavaScript-Templates/tags">Download</a></li>
  31. <li><a href="https://github.com/blueimp/JavaScript-Templates">Source Code</a></li>
  32. <li><a href="https://github.com/blueimp/JavaScript-Templates/blob/master/README.md">Documentation</a></li>
  33. <li><a href="test/">Test</a></li>
  34. <li><a href="https://blueimp.net">&copy; Sebastian Tschan</a></li>
  35. </ul>
  36. <form>
  37. <h2>Template</h2>
  38. <textarea rows="12" id="template"></textarea>
  39. <br>
  40. <h2>Data (JSON)</h2>
  41. <textarea rows="14" id="data"></textarea>
  42. <br>
  43. <button type="submit" id="render">Render</button>
  44. <button type="reset" id="reset">Reset</button>
  45. <h2>Result</h2>
  46. <div id="result" class="result"></div>
  47. <br>
  48. </form>
  49. <script type="text/x-tmpl" id="tmpl-demo">
  50. <h3>{%=o.title%}</h3>
  51. <p>Released under the
  52. <a href="{%=o.license.url%}">{%=o.license.name%}</a>.</p>
  53. <h4>Features</h4>
  54. <ul>
  55. {% for (var i=0; i<o.features.length; i++) { %}
  56. <li>{%=o.features[i]%}</li>
  57. {% } %}
  58. </ul>
  59. </script>
  60. <script type="text/x-tmpl" id="tmpl-data">
  61. {
  62. "title": "JavaScript Templates",
  63. "license": {
  64. "name": "MIT license",
  65. "url": "http://www.opensource.org/licenses/MIT"
  66. },
  67. "features": [
  68. "lightweight & fast",
  69. "powerful",
  70. "zero dependencies"
  71. ]
  72. }
  73. </script>
  74. <script type="text/x-tmpl" id="tmpl-error">
  75. <h3 class="error">{%=o.title%}</h3>
  76. <code>{%=o.error%}</code>
  77. </script>
  78. <script src="js/tmpl.js"></script>
  79. <script src="js/demo.js"></script>
  80. </body>
  81. </html>