开发者

jQuery template getting data back from target

iam talking abt this jquery-template http://api.jquery.com/jQuery.template/

var data={/*json*/};

//complie templa开发者_Go百科te
jQuery.template('some_name', jQuery('#templateId').html());

//fill elm with id=target.
jQuery('#target').html(jQuery.tmpl('some_name', data));

My question is there any way to get data object back from target. Iam not looking for any strategies rather some inbuilt templating functionality.


The tmplItem functionality will do this for you: http://api.jquery.com/tmplitem/

you can do something like:

var myTmplItem = $("#target").tmplItem();

Then access it like:

myTmplItem.data
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜