Category Archives: jQuery

TrafficCop: A jQuery Plugin To Limit AJAX Requests For A Resource

A while back, I wrote about asynchronous template loading for Backbone applications. At the bottom of that post, I showed some code that I wrote which would limit the number of AJAX calls that are made to the server, to … Continue reading 


Resizing KendoUI Splitter To Fill Screen Vertically

I dropped the jQuery.Layout plugin in favor of KendoUI’s Splitter control yesterday. Kendo’s Splitter is just so much easier to use and more flexible. It was a no-brainer for me, really. But I ran in to a problem: how to … Continue reading 


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 


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 


Asynchronously Load HTML Templates For Backbone Views

UPDATE: It turns out this is a really bad idea. Don’t async fetch individual templates. In the end, having done asynchronous fetching of individual templates on a few productions apps, it’s a really bad idea. The network latency and multiple … Continue reading 


Rewriting My ‘Guaranteed Callbacks’ Code With jQuery Deferred

In a previous post, I showed some code that I wrote to guarantee the execution of a callback method after a Backbone collection was loaded. Even if you added the callback after the collection had been loaded, it would run.¬†Shortly … Continue reading 


Don’t Rely Solely On jQuery’s “keyup” Event

A few days ago I pushed some changes to the form validation up to my WatchMeCode website. I was trying to fix a scenario where a browser cache would have some of the data in the purchase form already filled … Continue reading 


Backbone.js: Object Literals, Views Events, jQuery, and `el`

I’ve seen this question in various forms on StackOverflow, more than a few times: Why aren’t my view event callbacks are being fired? or My view events won’t fire. What am I doing wrong? or My view’s `el` is empty? … Continue reading 


Coordinating multiple ajax requests with jquery.when

While building a rich JavaScript application, you may get in a situation where you need to make multiple ajax requests, and it doesn’t make sense to work with the results until after all of them have returned. For example, suppose … Continue reading 

| Leave a comment

Test-Driving Backbone Views With JQuery Templates, The Jasmine Gem, and Jasmine-JQuery

In my current production rails app, I use Cucumber to test my backbone code as an integration test – to make sure that the entire system is playing nice.¬†Over the weekend, I decided to dive a little deeper into my … Continue reading