When load the new html from a post function I lose all of my click bindings. I read that i could use live to keep all the bindings but can’t find any examples where live is used with post. Here is my code:
$('.GroupHeader').unbind('click').live('click', function (event) {
event.preventDefault();
TemplateEditor.SelectGroupClicked($(this));
});
You should use
liveto bind your click event handlers, i.e.:Instead of :
In that way, doesn’t matter your elements are replaced, the events will still work, because
liveworks with event delegation.