The original official jQuery Templates plugin. This project was maintained by the jQuery team as an official jQuery plugin. It is no longer in active development, and has been superseded by JsRender.
3.23k
stars
1.01k
forks
source link
{{each}} fails for lists that contain null elements #75
If you pass a list with any null elements in it to {{each}}, it throws an error. For example:
<script type="text/x-jquery-tmpl" id="test"> {{each(index, item) items}} test {{/each}} </script> <script type="text/javascript"> $('#test').template("test"); $.tmpl('test', {items:[1,null,3]}) </script>
-------- Backtrace: Uncaught TypeError: Object function (a){return new l(a)} has no method 'push' (anonymous function) -- :2 d.d.extend.each -- jquery.min.js:16 anonymous -- :2 newTmplItem -- jquery.tmpl.js:32 jQuery.extend.tmpl -- jquery.tmpl.js:151
This is using http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.js