Accessing iframe

B

BillGatesFan

Alright, this is very strange. I call a javascript function in my page
load that accesses an iframe and I get an error. But if I wait till the
page completely loads and access the iframe through a click event
everything works fine.

I'm trying to set some of the iframe's properties on page load. Can I
do this? Please give examples. Thanks
 
M

marktm

The page must be completely loaded before you can reference an object
within the DOM.
Are you using <body onLoad="doSomething()"> ?

-M
 
T

Thomas 'PointedEars' Lahn

marktm said:
The page must be completely loaded before
you can reference an object within the DOM.

No. It is in most cases recommended to wait until that,
but, depending on the DOM, it is possible before.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top