backbone.js - In Backbone views, which is better: this.$el.find('.selector') or this.$('.selector')? -


both of these work, , ff console shows selecting same element, there advantage of using 1 on other?

from fine manual:

$ (jquery) view.$(selector)

[...] it's equivalent running: view.$el.find(selector)

so this.$(selector) short hand this.$el.find('.selector'). use whichever 1 prefer, there's no functional difference between them.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -