Chapter 5
Web Applications with jQuery and Backbone.js

JavaScript was born in the browser. From its birth in 1995 to the turn of the century, it was primarily used to “enhance” websites with special effects and clunky interactive features, often to their detriment. But JavaScript in the browser came into its own as a software development platform when Google launched Gmail, proving that a practical and feature-rich application could live on the Web with no need for Flash or other proprietary plugins.

Gmail’s success inspired intense interest in the Web as an app platform, but developers were stymied by the browser’s clunky APIs, made worse by inconsistencies (often undocumented) from one browser to another. Then, in 2006, 22-year-old John Resig launched jQuery, an open-source library that abstracted away many of the browsers’ problems and introduced an ingenious CSS-like element selection syntax. Today, jQuery is used by nearly one-third of the 10,000 most-visited websites.[35] Although browser APIs have become dramatically better and more standardized since jQuery’s initial release, the case for using jQuery remains strong. It works around hundreds of browser bugs, with only a small performance penalty.

As web applications have grown more complex, numerous MVC (Model-View-Controller) frameworks have cropped up to provide organizational structure. Of these, the most popular is Backbone.js, written primarily by CoffeeScript creator Jeremy Ashkenas. Backbone is a relatively minimal framework, making it suitable to a wide range of applications. Additionally, Backbone uses classes that are intercompatible with CoffeeScript classes, making it an especially strong choice for CoffeeScripters.

In this chapter, you’ll learn the basics of jQuery and Backbone.js as you build the first iteration of CoffeeTasks, a Trello-like task management application. (Trello is an infinitely more full-featured application than the one you’ll be writing in this chapter, but it uses many of the same technologies—including CoffeeScript.[36]) Going into great detail about these handy libraries would be beyond the scope of this book, so I encourage you to jump from this chapter into the (excellent) official docs[37] if you get stuck at any point.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.26.22