Bug Tracker

Modify

Ticket #10736 (closed bug: invalid)

Opened 19 months ago

Last modified 14 months ago

iframe load event

Reported by: Math. Owned by:
Priority: low Milestone: None
Component: event Version:
Keywords: Cc:
Blocking: Blocked by:

Description

jQuery does not handle load event for iframe which are not yet added to the document as you can do with img.

Test case:  http://jsfiddle.net/5KK7w/

Works: $('body').append('<iframe id="iframe1"/>'); $('#iframe1').load(function(){

alert('iframe loaded');

}).attr({'src':srcIframe});

Does not work: $('<iframe id="iframe1"/>').load(function(){

alert('iframe loaded'); $(this).appendTo('body');

}).attr({'src':srcIframe});

Change History

comment:1 Changed 19 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to event

If you watch the network traffic, you can see that the iframe src is not retrieved until the iframe is appended to the body. Therefore, it has not yet loaded as an image would.

comment:2 Changed 19 months ago by Math.

That's right and jQuery should handle this.

comment:3 Changed 19 months ago by timmywil

That's not something we can control. It has not loaded yet.

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.