重写tmpl的方法,用@替换$
$.fn.tpl = function(data){
$.template('template', $(this).html().replace(/@/g,"$"));return $.tmpl('template', data);
}
然后再通过tpl 来换取数据。
$("#"+nodeid).html($("#recordtmpl").tpl(data));
最后可以通过@来调用其他方法
重写tmpl的方法,用@替换$
$.fn.tpl = function(data){
$.template('template', $(this).html().replace(/@/g,"$"));}
然后再通过tpl 来换取数据。
$("#"+nodeid).html($("#recordtmpl").tpl(data));
最后可以通过@来调用其他方法