jQuery: live vs adding events manually

I have a table where I add, remove and resort rows from time to time. They contain two dynamic "things": The row itself need a mouseenter and mouseleave event for a hover effect, and a couple of buttons need a click event attached.

What are some arguments for choosing between the jquery.live method and attaching the events when creating the rows? I am pretty sure both ways of doing it has their positive and negative sides, but what are those? And are some kinds of events better suited for one than the other? Should I add some events in the regular manner and some in the live manner?

Answers


use delegate


Need Your Help

VB.Net write and read DataTable to/from XML-file

vb.net datatable xml

I'm trying to write a DataTable to an XML-file and read afterwards the data from the XML-file to another DataTable with the following VB.Net code, I'm getting the error "DataTable does not support ...

rails simple_form conditional field population

ruby-on-rails ruby haml simple-form

I need a field to populate a default value for a new record, but not on edit. I'm using haml and simple_form. This works, but feels inelegant. I'm sure there's a way to do this on a single line and...