Category Archives: DOM

$(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 

Also posted in Backbone, Javascript, JQuery, Principles and Patterns | 7 Comments

Managing A Modal Dialog With Backbone And Marionette

My current client project is using Twitter Bootstrap, and I have to say I’m loving it. It provides a simple way to get started with common layout and design elements, and includes a handful of UI widgets and features that … Continue reading 

Also posted in Backbone, Javascript, JQuery, Marionette, Twitter Bootstrap | 36 Comments

JavaScript Performance: Pre-Compiling And Caching HTML Templates

If you’re using HTML templates with a JavaScript application, you need to be caching the template’s raw text and/or pre-compiled version of the template. All of this spawned from a fun thread of discussion on a StackOverflow question. DOM Selection … Continue reading 

Also posted in Backbone, Javascript, JQuery, Marionette, Performance | 7 Comments

Backbone.js And JavaScript Garbage Collection

A question was asked on Stack Overflow recently, and I provided an answer that I think is worth re-blogging here (while cleaning up the text / grammar). My answer goes in to a little bit of the idea behind a garbage … Continue reading 

Also posted in Backbone, Javascript, Marionette | 12 Comments

Handling DOM Events With EmberJS Views And Controllers

Hot on the heels of picking up Ember and starting to learn it, I think I’ve actually learned something useful! I certainly hope I have, at least. Otherwise, I’m going to be in trouble soon. In my EmberCloneMail app, I … Continue reading 

Also posted in Ember, Javascript, JQuery, Model-View-Controller, Model-View-Presenter | 10 Comments

Using jQuery, Plugins and UI Controls With Backbone

Most Backbone applications either use jQuery or Zepto as their DOM manipulation of choice. I tend to use jQuery as it’s supported across more browsers and has more features – though it is a little heavier in terms of download … Continue reading 

Also posted in Backbone, HTML5, Javascript, JQuery, KendoUI, Marionette, Telerik, Tools and Vendors | 10 Comments