Skip to content

Instantly share code, notes, and snippets.

@qbunt
Created May 10, 2013 16:43
Show Gist options
  • Save qbunt/5555646 to your computer and use it in GitHub Desktop.
Save qbunt/5555646 to your computer and use it in GitHub Desktop.
Helps in killing of zombies.
destroyView = function (view) {
// completely unbind and destroy the view
view.undelegateEvents();
view.$el.removeData().unbind();
//Remove view from DOM
view.remove();
Backbone.View.prototype.remove.call(view);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment