You've got a lot of Gal

Yet another blog about Ruby, Rails, Javascript, Apple, Malteses and Shih-Tzus by Gal Steinitz

This site is completely static. It was last generated with Octopress and Jekyll on Sep 02, 2013 and hosted on github pages.

Update to "Fire and Consume Custom Global Events in jQuery"

Update 9-8-2012: Global events with Backbone JS

This is an update to a previous post

jQuery 1.4 is out, and the undocumented syntax I described for triggering and responding to global events has changed. You can still use the same pattern. When firing a global event, bind to any element on the DOM, such as ‘body’ or document:

1
2
$(document).bind("sneeze",function(){})
$.event.trigger("sneeze");

This is a great way to decouple code and when used like a messaging system, can really clean up your code.