Question

Is there a list of which filters can be used in selectors for the live method?

I had a case where I needed to bind an event to all the tr's in a table body excluding the first.

Broken Live Example:

$('#ExampleTable tbody tr:not(:first)').live("dblclick", RowEvent);

This would select the correct rows but the live event would bleed over onto all tables and all tr's even tho the selector would only pick the correct ones.

Working Live Example:

$('#ExampleTable tbody tr:gt(0)').live("dblclick", RowEvent);

This selector also uses filters but it works correctly.

Both selectors used filters but only the second worked. Is this a bug or am I doing some thing wrong?

Was it helpful?

Solution

Filed as a bug on Jquery.
Bug: Live event binding not matching selector

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top