The plugins site is currently in development.
We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.
jsRepeater - HTML Templating
HTML Templating with minimal javascript
$('#myDiv').fillTemplate(myData)
The jsRepeater makes it easy to fill HTML Templates with javascript objects e.g. data received from the server via AJAX
<script>
var myData = {"Name" : "Google", "Type" : "Search Engine", "URL" : "www.google.com"};
$('#template1').fillTemplate(myData);
</script>
<body>
<div id='template1'>${Name} is a ${Type} found at <a href='${URL}'>${URL}</a></div>
</body>results in:
Google is a Search Engine found at www.google.com
This is the most basic example. The power of jsRepeater lies in the fact that it has support for some of the more complex functionality we need in the real world e.g.
- Binding not only to an object but child objects in one template
- Ability to write your own javascript functions for output formatting
- Access to numbering in a loop
- No need for alternating templates, alternation handled in markup, not only even and odd values but also first and last
- Infinite recursion down an object graph in one template
