Book Image

Backbone.js Essentials

By : Jeremy Walker
Book Image

Backbone.js Essentials

By: Jeremy Walker

Overview of this book

<p>This book offers insight into creating and maintaining dynamic Backbone.js web applications. It delves into the the fundamentals of Backbone.js and helps you achieve mastery of the Backbone library.</p> <p>Starting with Models and Collections, you'll learn how to simplify client-side data management and easily transmit data to and from your server. Next, you'll learn to use Views and Routers to facilitate DOM manipulation and URL control so that your visitors can navigate your entire site without ever leaving the first HTML page. Finally, you'll learn how to combine those building blocks with other tools to achieve high-performance, testable, and maintainable web applications.</p>
Table of Contents (20 chapters)
Backbone.js Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Getting started with Mocha


To use Mocha, you will first need to download the mocha.css and mocha.js files from the project's GitHub page (which can be found at https://github.com/mochajs/mocha). You will also need to download an assertion library; for this example, we'll be using Expect.js (which you can download from https://github.com/Automattic/expect.js).

Next, you will need to create a new HTML page and add script tags for all of your application's JavaScript files, as well as all library files (for instance, Backbone and jQuery). You'll also need to add a few bits of Mocha boilerplate code. All together you should wind up with an HTML file that looks something like the following:

<html>
<head>
<!-- External Library Files -->
<script src="/underscore.js"></script>
<script src="/jQuery.js"></script>
<script src="/Backbone.js"></script>

<!-- Application-Specific Files -->
<script src="/SomeModel.js"></script>
<script...