Accessing dom/js inside frame inside iframe

oplin

Gawd
Joined
Jan 9, 2002
Messages
831
Hey got a big problem here, if anyone can help that would be great.

I have an iframe, that has a frameset in it, that has frames in there and i want to access an element on the innermost frame outside of the iframe. Is this possible? In the dom model i can see element. The iframe takes a little while to display and is displayed after the page loads so this might be the problem.

basic frame structure looks like this

<html>
<Iframe id="grid">
<--inside iframe-->
<frameset>
<frame id="main">
<a class"tittle" id="ttl">text i want</a>
</frame>
</frameset>
</Iframe>
java script here that i want to use to grab text in iframe
</html>

This is what i've been trying
//alert(frames["hpiGrid"].document.frames["main"].document.all["ttl"].innerText);
// alert(window.frames['hpiGrid'].document.getElementById('ttl'));
//alert(window.frames['hpiGrid'].frames['main'].document.all['ttl'].innerText);
 

oplin

Gawd
Joined
Jan 9, 2002
Messages
831
window.frames['hpiGrid'].frames['main'].document.all['ttl'].innerText

that worked, i needed to wait until the iframe was fully rendered until i could access it.
 
Top