【问题标题】:Chaining jquery template appendTo method链接 jquery 模板 appendTo 方法
【发布时间】:2011-04-22 21:36:07
【问题描述】:

是否可以像这样链接jQuery模板的appendTo方法:

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

                        alert('test');

                    });

我记得之前做过,但在上面的代码中它不起作用,但我也没有收到错误。

【问题讨论】:

    标签: jquery jquery-templates


    【解决方案1】:

    是的,

    $(a).appendTo(b)
    

    返回一个等效于$(a)的jQuery对象

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-29
      • 2016-10-10
      • 2011-06-20
      • 1970-01-01
      相关资源
      最近更新 更多