The problem I typically ran in to was that I was continually binding the same event handlers on top of already existing handlers every time the Ajax was invoked. In those cases, I had to unbind the event handlers before binding the new event handler which seemed like a lot of extra work for no good reason: $(‘.some_class’).unbind(‘click’).click( function… or $(‘.time_field’)unmask().mask(’99:99′).
That lead me to my discovery of the live() handler. live() allows you to bind events for all objects matching a selector at the time of execution AND for any new items added to the DOM. This lead to further simplification of my code. No longer did I need to tack on a little JS function when returning my rendered partial to adorn the fields needing extra behaviours when live() would take care of that for me. I really wish I knew about that before.