Backbone Dependencies: Jquery
Backbone has two big dependencies: jqeury and underscore
jQuery
Been around since 2006. Make the DOM easy to work with. Pass in CSS selectors then actions.
Goes through an example.
- Selector (CSS - style)
- attach Handler (click)
- $.post to a route
- display result in a callback on a DOM element
> "The DOM is a mess" - John Resig
Lots of inconsistencies in the DOM api. Especially older IE.
jQuery is a DOM Library
but it is not for organising and managing applications. Goes back to previous example: all these chainings encourage anti-patterns: not object-orient programming, coupling user interactions to data manipulation, everything very procedural, in-line (chaining) style
It can fall apart at large scale.