You are previewing Instant Backbone.js Application Development.
O'Reilly logo
Instant Backbone.js Application Development

Book Description

Build your very first Backbone.js application covering all the essentials with this easy-to-follow introductory guide

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results

  • Structure your web applications by providing models with key-value binding and custom events

  • Keep multiple clients and the server synchronized

  • Persist data in an intuitive and consistent manner

In Detail

It’s easy to let a project get out of hand and become completely unmaintainable. However, this can be avoided by building a nicely-structured Backbone.js application. When working on a web application involving a lot of JavaScript, applications may end up as tangled piles of jQuery selectors and callbacks, all trying frantically to sync between the HTML UI, JavaScript logic, and the database on your server. With Backbone.js, you represent your data as models that can be created, validated, destroyed, and saved to the server.

Instant Backbone.js Application Development is a beginner-friendly book that will guide you through a step-by-step process to go from an empty project directory to a fully-functioning web application. The book also includes code samples that are easy to use and will guide you through the major features that Backbone.js has to offer.

Instant Backbone.js Application Development looks at the main types of objects that Backbone.js offers and has you instantiate specialized versions of each. These objects are stored in their own individual files and work together to build well-structured applications.

Your data will be stored using Collections and Models and presented to the user through Views and Templates. URLs will remain pretty and your browsing history will still work thanks to the Routing functionality. You will also learn how to build a JavaScript Single Page Application that communicates smoothly with your backend server using AJAX.

Table of Contents

  1. Instant Backbone.js Application Development
    1. Instant Backbone.js Application Development
    2. Credits
    3. About the Author
    4. About the Reviewers
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
    6. packtlib.packtpub.com
      1. Why Subscribe?
      2. Free Access for Packt account holders
    7. 1. Instant Backbone.js Application Development
      1. So, what is Backbone.js?
      2. Installation
        1. Step 1 – what do I need?
        2. Step 2 – creating a folder
        3. Step 3 – downloading the necessary files
        4. Step 4 – creating new files
        5. And that's it!
      3. Quick start – building a Hello World app
        1. Step 1 – adding code to the document
        2. Step 2 – adding code to the main script
        3. Step 3 – opening the project in your browser
        4. Step 4 – encountering a problem
          1. The missing script file
          2. The script typo
      4. Top 5 features you need to know about
        1. Models and Collections
          1. Step 1 – creating some files and folders
          2. Step 2 – updating the main script
          3. Step 3 – updating the document
          4. Step 4 – updating the Contact model
          5. Step 5 – updating the Contact collection
          6. Step 6 – refreshing the browser
        2. Views and Templates
          1. Step 1 – creating some files and folders
          2. Step 2 – updating the Contact view
          3. Step 3 – updating the directory view
          4. Step 4 – updating the document
          5. Step 5 – updating the main script
          6. Step 6 – refreshing the browser
          7. Event listener examples
        3. View events
          1. Step 1 – getting ready
          2. Step 2 – updating the document
          3. Step 3 – updating the Contact view
          4. Step 4 – updating the directory view
        4. URL-based routing
          1. Step 1 – creating a router script
          2. Step 2 – updating the document
          3. Step 3 – updating the main script
          4. Step 4 – updating the Contacts view
          5. Step 5 – updating the directory view
        5. Persisting data to a server
          1. Step 1 – getting ready
          2. Step 2 – creating a server script
          3. Step 3 – updating the Contacts collection
          4. Step 4 – updating the main script
          5. Step 5 – updating the router
          6. Step 6 – updating the Contact view
          7. Step 7 – updating the directory view
          8. Step 8 – running the server
      5. People and places you should get to know
        1. Official sites
        2. Community
        3. Twitter