Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referring an iframe inside a layer for innerHTML 1

Status
Not open for further replies.

Qrosity

Technical User
Jan 9, 2008
14
ES
I have an iframe called "inside" inside a layer called "object" and i would like to populate it with innerHTML, I know how to do it with the layer, but not with the iframe inside...
THI WORKS FOR THE LAYER:
---------------------------------------------------------
document.getElementById(object).innerHTML = streetHTML;
---------------------------------------------------------
But, how can I reach the IFRAME?
If I include the Iframe tag inside the streetHTML var in wont work afterwords for other purposes, I'm afraid...
 
Have you tried:
Code:
document.frames['inside'].innerHTML = streetHTML;

I'd guess you need to target a specific container in the frame, though. Something like:
Code:
document.frames['inside'].document.getElementsByTagName('body')[0].innerHTML = streetHTML;

Lee

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top