Closed Bug 60173 Opened 24 years ago Closed 23 years ago

RFE - IFRAME supporting onload event.

Categories

(Core :: DOM: Events, defect, P3)

defect

Tracking

()

VERIFIED DUPLICATE of bug 122150
mozilla0.9.1

People

(Reporter: mgalli, Assigned: jst)

Details

(Keywords: dom2)

Attachments

(4 files, 1 obsolete file)

This discussion started at mozilla newsgroups and jst suggested to file here as 
RFE:

So the request is for IFRAME element to support the attribute ONLOAD, example:

<iframe onload="notifier()" src="page.html">
</iframe> 

I have originally posted the note in the discussion because I just noted that 
applications may access content from an iframe. In many cases developers are:

1) modifying the source document for the iframes in an way onload event notify 
the parent document. This is simple when applications are loading iframes with 
HTML.

Now, by using XML, the ONLOAD attribute/event in an IFRAME will help developers 
to know when the content is ready - so they will be able to access, etc. Even 
for HTML is a cool feature because there is no need to edit the child document 
(onload attribute in the body).
seem to be a dup of bug 57636 !
Summary: RFE - IFRAME supporting onload event. → RFE - IFRAME supporting onload event.
Nope, not a dup of 57636.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Windows 98 → All
Hardware: PC → All
I think this would be a great feature! But lets not stop at onload. How about 
all events get passed? For instance, if a user clicks in the frame then tell 
the page. Any references to elements on the page could be left null. BTW: I 
hate security :)
proposing target version of mozilla0.8 (it's significant for one of my 
customers) and adding nisheeth@netscape.com, joec@netscape.com to cc list
Keywords: mozilla0.8
Keywords: dom2
Component: DOM Level 2 → DOM Events
Keywords: mozilla0.9
Keywords: mozilla0.8.1
Keywords: mozilla0.8
ie supports onload on iframe...
Let's not stop at iframe. Imagine onload fired upon img, object or embed!
Every element that required loading should be able to fire load or unload event.
 
<img> already supports onload...
Attached patch Proposed fix.Splinter Review
Target Milestone: --- → mozilla0.9.1
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Just to make sure, does the onLoad get fired after the page in the frame is 
loaded or before?
Let's see... what would be the point of firing an onLoad event before the
document is loaded.. hmm.. oh yes, I know, so we seem to be faster than IE! Well
thought, jst!
QA Contact Update
QA Contact: vidur → vladimire
Verifying fixed on 2001-05-31-08-trunk linux RedHat
and 2001-05-29-08-trunk windows 98
Status: RESOLVED → VERIFIED
I intend to reopen this bug as all test run locally (via file: url) to get the
onload of an iframe element to fire fail.
I am going to reopen this bug as I don't get the onload to fire when both the
containing html page and the iframe page are loaded via file url. This means the
test case I just uploaded works, to reproduce the problem you need to download both
  http://bugzilla.mozilla.org/attachment.cgi?id=66678&action=view
and
  http://bugzilla.mozilla.org/attachment.cgi?id=66681&action=view
and then obiously edit the latter to adjust the iframe src attribute value to
point to the local file. Then just load the page and you see that the iframe
reloads itself every 5 seconds but the event handlers are not fired as otherwise
that would be outputted below the iframe.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
martin.honnen@t-online.de - please create a new bug for the problem you're
describing and close this bug.
Is there not a bug on this (iframes/onload/file urls) already?
martin.honnen@t-online.de - the problem your decribing already has its bug: bug
122150. That bug already has a patch that has s= and sr=, not checked in yet.
Could someone please mark this bug as closed? I don't have the rights to do it.
btw.. don't mark this bug as a duplicate: it isn't, it just shouldn't have been
reopened.
Bug http://bugzilla.mozilla.org/show_bug.cgi?id=122150 is not about iframe
elements but about frame elements. 
Iframes and frames share the same code, so the fix for bug 122150 will also fix
this. Marking FIXED again.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
reopening to mark a dup
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

*** This bug has been marked as a duplicate of 122150 ***
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → DUPLICATE
verifying
Status: RESOLVED → VERIFIED
<iframe onload="..."></iframe> works, but not after the iframe's "src" attribute is set by Javascript later on. See attached content_iframe.html.

Since <iframe> doesn't have to contain an initial value of "src" attribute
- 1. should it fire onload handler even then, before "src" is set?
- 2. it seems natural to expect that it would fire onload handler after "src" is set later on.

(John, I've picked on you, because the last two commenters on this issue had no activity in the last year.)
Flags: needinfo?(jst)
Flags: needinfo?(jst)
Attached file content_iframe.html
Hi :jst,

Apologies: ignore my last comment, no need to action/change anything. Indeed, <ifame onload="..."> works even when iframe's "src" attribute is set subsequently (i.e. later). My attachment content_iframe.html was incorrect. I've updated it now.
Attachment #8733610 - Attachment is obsolete: true
Hey Peter,

Thanks for catching that on your own and updating this bug! Going forward it'd be better to file new bugs in bugzilla than commenting on old closed existing bugs, much higher chance of your issue getting attention that way.

Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: