In doc :
$ (jQuery or Zepto). $ (selector)
If jQuery or Zepto is included in the pages, each view has a $ function that runs the queries that are covered within the view element. If you use this jQuery function with a scope, you should not use model identifiers as part of your query to pull out specific elements in a list and can rely more on attributes of the HTML class. This is equivalent to running: view.$el.find(selector)
ui.Chapter = Backbone.View.extend({ serialize : function() { return { title: this.$(".title").text(), start: this.$(".start-page").text(), end: this.$(".end-page").text() }; } });
In short, he used to access some View elements with familiar syntax.
raina77ow
source share