Skip to main content

Bug Tracker

Side navigation

#10736 closed bug (invalid)

Opened November 09, 2011 05:42PM UTC

Closed November 09, 2011 07:01PM UTC

Last modified March 14, 2012 10:46AM UTC

iframe load event

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

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

Test case:


$('body').append('<iframe id="iframe1"/>');


alert('iframe loaded');


Does not work:

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

alert('iframe loaded');



Attachments (0)
Change History (3)

Changed November 09, 2011 07:01PM UTC by timmywil comment:1

component: unfiledevent
priority: undecidedlow
resolution: → invalid
status: newclosed

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.

Changed November 09, 2011 07:34PM UTC by Math. comment:2

That's right and jQuery should handle this.

Changed November 09, 2011 07:43PM UTC by timmywil comment:3

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