#10736 closed bug (invalid)
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: 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 (3)
comment:1 Changed 11 years ago by
Component: | unfiled → event |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
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.