One background issue that keeps cropping up is that with our current JS code, we need to explicitly initialize handlers for any new content that's loaded on the page. That's why, for example, AJAXified polls and the cut tag expander wouldn't play nice at first. We had to tell the cut tag expander to explicitly initialize the JS for any polls in the newly loaded cut tag content.
As you can imagine (Bob) this isn't very fun. Inevitably, we end up forgetting edge cases, which we only turn up after a user has run into the issue and reported it. (We probably have three or four outstanding bugs that have to do with how we haven't called the init function on this page, or after doing that action, and well it's a pain.)
So a thought: I propose we start using
jQuery's .live() function in conjunction with a custom event.
( cut for examples and discussion of efficiency )ETA:
It looks like
.delegate() is a better alternative to .live() (thanks
jproulx!