Skip to main content

Bug Tracker

Side navigation

#7702 closed bug (invalid)

Opened December 05, 2010 12:21AM UTC

Closed December 05, 2010 06:30AM UTC

Last modified March 13, 2012 10:30PM UTC

.live/.delegate do not work for .load events

Reported by: RTPMatt Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

The docs say .live works for all events now, but I can't seem to make them work for load event. #6143seems to say the same thing, but was closed. Here is my test case:

http://www.jsfiddle.net/Cj64g/

Attachments (0)
Change History (5)

Changed December 05, 2010 02:36AM UTC by anonymous comment:1

http://www.jsfiddle.net/Cj64g/2/

Fixed the delegate tests case, same result.

Changed December 05, 2010 06:30AM UTC by danheberden comment:2

resolution: → invalid
status: newclosed

The way that live and delegate work is by using event bubbling. That is, the events that travel up the dom tree, alerting their parents of the activity.

The load event, unfortunately, is not an event that bubbles. (see http://en.wikipedia.org/wiki/DOM_Events for a list of events and if they bubble)

Good work on distilling the problem down - it looks like you'll do great helping us find and eliminate bugs as we move forward :D

Oh, and as an example of my ramblings, notice how the load event on the parent div doesn't fire: http://www.jsfiddle.net/danheberden/EpfzF/

Dan

Changed December 05, 2010 06:33AM UTC by danheberden comment:3

To reduce future confusion, we'll update the documentation to specify events that bubble. So good that you brought it to our attention.

Changed December 05, 2010 06:38AM UTC by danheberden comment:4

keywords: → needsdocs

Changed December 06, 2010 06:52AM UTC by danheberden comment:5

keywords: needsdocs