2007-10-22

Refer to the containing object in the jQuery callback function

From a Learning jQuery post by Mike Alsup:
...
var self = this;

$('#myElement').click(function() {
  // here you can use 'self' to reference
  // the enclosing object
});
...
Duh!