background preloader

Backbone.js

Facebook Twitter

ClearTimeout on dynamically updating timer. Building a single page app with Backbone.js, underscore.js and jQuery | &yet | the blog. Overview We've been finding ourselves building more and more JS heavy apps here at &yet. Until recently, we've pretty much invented a custom app architecture for each one. Not surprisingly, we're finding ourselves solving similar problems repeatedly.

On the server side, we use django to give us an MVC structure to follow. But there's no obvious structure to your client-side code. There are some larger libraries that give you this, but usually have a ton of widgets etc. But for those of us who want to lovingly craft the UI exactly how we want them in the JavaScript we know and love, and yet crave quick lightweight solutions, those toolkits feel like overkill. Recently something called Backbone.js hit my "three tweet threshold" I decided to take a look.

The Problem There are definitely some challenges that come with building complex, single-page apps, not the least of which is managing an ever increasing amount of code running in the same page. The Goals So, how do we want our app to behave? (37) What are some good resources for Backbone.js. Getting Started with Backbone.js. Unlike its web development peers, JavaScript has never really had much in the way of frameworks to provide structure. Thankfully, in recent years, that's beginning to change. Today, I'd like to introduce you to Backbone.JS, a sweet little library that makes the process of creating complex, interactive and data driven apps so much easier. It provides a clean way to surgically separate your data from your presentation.

Overview of Backbone.JS Created by Jeremy Ashkenas, the JS ninja who built CoffeeScript, Backbone is a super light-weight library that lets you create easy to maintain front ends. Backbone is a collection of cohesive objects, weighing in at a shade under 4kb, that lend structure to your code and basically helps you build a proper MVC app in the browser. Let's face it: the above is a little hard to parse and make sense of. Key-value binding and custom events Rich API of enumerable functions Views with declarative event handling Your days of writing spaghetti bind calls are over.

Backbone.js Tutorials.