Since Backbone is a frontend library, it's something we'll need to be serving to the client. We've set up our Express app to statically serve the files in our public
directory, and added several script tags to the index.ejs
file, but we haven't created these things yet.
So, create a directory named public
in your project directory. Now download the latest versions of Underscore (http://underscorejs.org), Backbone (http://backbonejs.org), and jQuery (http://jquery.com) and put them in this folder. It's very likely that newer versions of these libraries have come out since this book was written. Since updates to these projects could change the way they work, it's best to stick to the following versions:
Backbone: Version 1.1.2
Underscore: Version 1.6.0
jQuery: Version 2.0.3
I will mention here that we're including Underscore and jQuery because Backbone depends on them. Actually, it only really depends on Underscore, but including jQuery does give us a few extra features that we'll be happy to have. If you need to support older versions of Internet Explorer, you'll also want to include the json2.js
library (https://github.com/douglascrockford/JSON-js), and switch to a version of jQuery 1 (jQuery 2 doesn't support older versions of IE).