テンプレートエンジン的な使い方をするテンプレートエンジン以外の何かを作ってみました。 JUI発表版のTwittelienで必要になったので作ったけどとりあえず版なので性能とか度外視です。 Templalien本体 function Templalien(template){ this._template = jQuery(template); }; Templalien.prototype.merge = function(context){ var template = this._template.clone(); jQuery.each(context,function(selector,func){ var elem = selector ? template.find(selector) : template; func(elem); }); return template; }