Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Onload in an iframe

Onload in an iframe

Mr J
10-13-2005, 04:47 PM
Are there any cross browser problems regarding the use of the onload event in an iframes tag?

Thanks

Kor
10-13-2005, 05:08 PM
document.getElementById('iframe_id').contentWindow.window.onload=function(){...do something...}

The piece of code is crossbrowser AFAIK, at least for modern browsers.

...maybe the fact that it is safer to use the full root window in code should be a problem when dealing with frames/iframes...

Mr J
10-13-2005, 06:37 PM
Thanks Kor, just wanted to make sure that onload in an iframe tag was still a viable option.
:thumbsup:

Kor
10-14-2005, 08:41 AM
I see that W3C recomadation for HTML 4.0 don't specify the onload amongst the iframe's attributes, but I guess that as, in fact, inner frames inherit all the frame's (and frameset's) attributes/methods, thus they accept onload as handler/event as well.

Mr J
10-14-2005, 02:05 PM
Kor

I see that W3C recomendation for HTML 4.0 don't specify the onload amongst the iframe's attributes

I had a quick look myself but did not come across anything positive so I thought I'd play it safe and simply ask the experts, just in case :D

Once again thanks :thumbsup:


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

help with rollover menu
Writing form data to another value in a different window
Using Javascript to set Stylesheet based on Browser, not Recognized
hide elements based on ID
Session Timeout - javascript
check if one of a group of radio buttons have been checked
How to change the checked item on a radio type with javascript
check if any of the options value consist of

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics