I'm pretty sure that the answer isn't that difficult, but I'm not sure where to look for it.
I would like to attach a jQuery event handler when a div gets created. For example:
$('#somediv').click(function(){
//do something
});
But... #somediv
doesn't exist. Because of some AJAX loads it will. So what I need is something like.
$('#somediv').whenImcreated(function(){
$(this).click(function(){
//do something
});
});