2011-04-22 43 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)