Bug Tracker

Modify

Ticket #6016 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

live() Fails on jQuery'd content

Reported by: brendo_ Owned by:
Priority: major Milestone: 1.4.2
Component: event Version: 1.4.1
Keywords: events Cc:
Blocking: Blocked by:

Description

See the test case, it's the best way I can describe it.

Attachments

brendan.html Download (921 bytes) - added by brendo_ 3 years ago.
Test Case

Change History

Changed 3 years ago by brendo_

Test Case

comment:1 Changed 3 years ago by brendo_

I believe this could be because jQuery() doesn't return a set anymore in 1.4?

That said, what's the best way to do what in the test case now?

comment:2 follow-up: ↓ 3 Changed 3 years ago by john

  • Status changed from new to closed
  • Resolution set to invalid
  • Component changed from unfilled to event

Naturally - how would that work? The point of live events is that it uses a selector to find elements to keep them up-to-date. If you're working against a document fragment (or a single element, in this case) then there's nothing to keep up to date. Live events work by doing event delegation - doesn't seem like using event delegation makes sense in this case, just use regular bind.

comment:3 in reply to: ↑ 2 Changed 3 years ago by brendo_

Ah ok, seems like a misunderstanding on my behalf then.

Does this mean the correct way to attach events to elements that are added to the document using after/before/append/prepend should be through bind and not live?

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.