Hello Backbone.js

Shameless advertisement: Don't forget to check out Agility.js, a simpler alternative to Backbone.js.

Hello Backbone is a simple Backbone.js tutorial comprised of self-explanatory "hello world" examples of increasing complexity. It was designed to provide a smoother transition from zero to the popular Todos example.

Backbone.js offers a lean MVC framework for organizing your Javascript application. It leads to more maintainable code by untangling the "spaghetti" of callbacks tied to different parts of the DOM and the backend server that often arises in rich client-side applications.

The tutorial starts with a minimalist View object, and progressively introduces event binding/handling, Models, and Collections.

Start the tutorial

Once in the tutorial, use the navigation menu in the top-right corner to view other examples. Example numbers are in order of increasing complexity.

 

Copyright © Artur Adib [ arturadib.com ]

Follow me on Twitter: @r2r

The only non-Javascript part of the examples is the following HTML template:

  <!DOCTYPE html>
  <html>
  <head>
    <meta charset="utf-8">
    <title>hello-backbonejs</title>
  </head>
  <body>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script src="http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
    <script src="http://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.6/underscore-min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.0/backbone-min.js"></script>

    <script src="...number.js..." type="text/javascript"></script>
  </body>
  </html>
            
Fork me on GitHub