What's the difference between: $(this.el).html and this.$el.html

前端 未结 6 1032
说谎
说谎 2020-12-13 02:26

What\'s the difference between:

$(this.el).html

and

this.$el.html

Reading a few backbone examples and so

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 02:50

    Wrapping an element in $() appends the jQuery extensions to the object prototype. Once that's done it doesn't need to be done again, although there's no harm other than performance in doing it multiple times.

提交回复
热议问题