Monthly Archives: May 2012

$(function(){…}) vs (function($){…})($) or DOMReady vs The Module Pattern

This was originally a StackOverflow question. I’m re-posting here because I think the question is fairly common, and I like the answer that I provided.  Why define anonymous function and pass it jQuery as the argument? This is the original … Continue reading 

Posted in Backbone, DOM, Javascript, JQuery, Principles and Patterns | 7 Comments

Backbone.Syphon: Serialize Form Inputs To JavaScript Objects

Working with form elements in a Backbone view can become very tedious very quickly. You will either end up writing a lot of repetitive code to read values from the form, or end up using a key-value-observer or data-binding solution … Continue reading 

Posted in Backbone, Backbone.Syphon, Javascript, JQuery, JSON | 25 Comments

Workflow In Backbone Apps: Triggering View Events From DOM Events

In my previous blog post, I talked about modeling an explicit workflow in JavaScript and Backbone application. The last code sample I showed had the implementation of the workflow object itself, but omitted all of the details of the views … Continue reading 

Posted in Backbone, Javascript, Workflow | 10 Comments

Modeling Explicit Workflow With Code, In JavaScript And Backbone Apps

A long time ago, in what seems to be a previous life at this point, I wrote a small blog post about modeling and creating an explicit return value from a dialog form in a Windows application. Fast forward a … Continue reading 

Posted in AntiPatterns, Backbone, Javascript, Principles and Patterns, Workflow | 14 Comments

Help Me Improve The Marionette Wiki

Documentation is difficult to write, and even more difficult to write well so that it covers all of the nuances and details that the people building the actual project tend to assume and forget. My Marionette project is no different. … Continue reading 

Posted in Community, Marionette | 6 Comments

Wrapping $.ajax In A Thin “Command” Framework For Backbone Apps

A large number of my recent client applications, built on Backbone, have been using straight jQuery AJAX calls. Sometimes its in combination with Backbone’s persistence method, but other times I end up using AJAX calls in place of Backbone calls. … Continue reading 

Posted in AJAX, Backbone, JQuery, Semantics, Underscore | 7 Comments