Modify ↓
Ticket #9666 (closed bug: patchwelcome)
Cannot detect when an IFRAME has finished loading with .delegate and .live
| Reported by: | cjoudrey | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | event | Version: | 1.6.1 |
| Keywords: | neededdocs | Cc: | |
| Blocking: | Blocked by: |
Description
Detecting when an IFRAME has finished loading can be done using .load(), but .live('load', ..) and .delegate('...', 'load', ...) do not seem to work.
Test case: http://jsfiddle.net/AYY8m/1/
- Chris
Change History
comment:1 Changed 2 years ago by dmethvin
- Keywords needsdocs added
- Priority changed from undecided to low
- Status changed from new to closed
- Component changed from unfiled to event
- Resolution set to patchwelcome
comment:2 Changed 23 months ago by addyosmani
- Keywords neededdocs added; needsdocs removed
Updated: http://api.jquery.com/load-event/
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Sounds like we'll just need to document this: "The .live() and .delegate() methods cannot be used to detect the load event of an iframe."
The load event doesn't bubble up to the parent document, and the event.target isn't set by Firefox, IE9, or Chrome which we need to be able to do event delegation anyway. In Chrome the frame load event even fires *after* the parent document load, which was unexpected to me!
http://jsfiddle.net/dmethvin/AYY8m/2/