Boris Moore jsRender http://www.borismoore.com/を使用しており、各アイテムのインスタンスを取得しようとしています。誰もそれを行う方法を知っていますか?
//render
$("divName").html(
$('#templateName').render('data')
);
//get instance. Here is my problem
$(".PriceFromPerHotel").each(function () {
selectedItem = $.tmplItem(this);
});
の使用により
selectedItem = $.tmplItem(this);
エラーメッセージが表示されます
Object function (a,b){return new e.fn.init(a,b,h)} has no method 'tmplItem'
編集
jQuery テンプレート ライブラリを追加することで no method 例外が解決されました。今の問題は、空のオブジェクトを取得していることです。インスタンスを返しません。
これが私のhtmlコードです
<script id="templateName" type="text/x-jsrender">
<div class="resultsBox">
//lot of code has here
<p class="offerSiloPrice">{{:Currency}} <span class="PriceFromPerHotel"></span></p>
</div>
ありがとう