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: |
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:
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});
Attachments (0)
Change History (3)
Changed November 09, 2011 07:01PM UTC by comment:1
component: | unfiled → event |
---|---|
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
Changed November 09, 2011 07:34PM UTC by comment:2
That's right and jQuery should handle this.
Changed November 09, 2011 07:43PM UTC by comment:3
That's not something we can control. It has not loaded yet.
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.