Bug Tracker

Modify

Ticket #4939 (closed bug: worksforme)

Opened 4 years ago

Last modified 4 years ago

Using the not() filter negates the live() method

Reported by: webbower Owned by: brandon
Priority: major Milestone: 1.4
Component: event Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

$('#list .entry').not('.doc_entry').live('click', function(e) { ... }

This should apply the live click event handler to all elements with class="entry" inside id="list" that are not also class="doc_entry" however, the not() filter makes the live event binding fail.

Maybe I'm just writing the not() filter wrong, but removing it allowed the live event binding to work.

Change History

comment:1 Changed 4 years ago by dmethvin

I think it's working according to the limits in the docs:

 http://docs.jquery.com/Events/live#typefn

Live events currently only work when used against a selector. For example, this would work: $("li a").live(...) but this would not: $("a", someElement).live(...) and neither would this: $("a").parent().live(...).

comment:2 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

Working as documented.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.