Test case for jQuery Ticket 8339
$.template with jQuery obj as 2nd param
by jitter
HTML
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<table id="one"></table>
<table id="two"></table>
<table id="three"></table>
<table id="four"></table>
<script id="tmpl-holder" type="text/x-jquery-tmpl">
<tr>
<td>${foo}</td>
<td>bar</td>
<td>smurf</td>
</tr>
</script>
CSS
tr { border: 1px solid #F00 }
JavaScript
var newRow =
'<tr>' +
' <td>${foo}</td>' +
' <td>bar</td>' +
' <td>smurf</td>' +
'</tr>';
$(newRow).appendTo('#one');
$.template('two', newRow);
$.tmpl("two", { foo: 2 }).appendTo('#two');
$.template('three', $(newRow));
$.tmpl( 'three', { foo: 3 }).appendTo('#three');
$.template('four', $("#tmpl-holder"));
$.tmpl( 'four', { foo: 4 }).appendTo('#four');