2011-04-22 72 views
2

是否有可能链的jQuery模板的appendTo方法是这样的:链接jQuery的模板appendTo方法

$("#total-costs-template").tmpl({ CurrentMortgage: vm.currentMortgage, Products: products }).appendTo("#total-costs-analysis").find("#total-costs-month").click(function() { 

         alert('test'); 

        }); 

我记得以前doint,但在它不工作上面的代码,我没有得到任何虽然错误。

回答

4

是,

$(a).appendTo(b) 

返回一个jQuery对象,这相当于$(a)