$.View is a client-side template solution. It populates HTML templates with data.
It comes with four pre-packaged template engines, which can be downloaded from the following websites:
EJS: http://embeddedjs.com (default one created by JMVC team)
jQuery templates: http://api.jquery.com/category/plugins/templates
It's easy to extend it by using $.View.register
.
Templates can be embedded in the HTML documents or loaded synchronously or asynchronously from external files. $.View supports template caching and bundling in the production builds.
Templates are embedded in the HTML documents as follows:
Let's copy the following code into index.html
file:
<script type='text/ejs' id="accounts"> <p>JavaScriptMVC is <%= message %></p> </script>
Also, copy the following code into file jquerymx_playground_2.js
:
steal( 'jquery/view', 'jquery/view/ejs', function...