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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

frames problem

Status
Not open for further replies.

shades44

Programmer
Jun 14, 2004
25
CA
Hello,

I have a page with two frames in it as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>title</title>
</head>
<frameset>
<frame name="banner" src="banner.aspx">
<frame name="main" src="main.aspx">
</frameset>
</html>

is there anyway i can access something inside 'main' from here? im trying to add a small script to every page that gets loaded into 'main'..

document.getElementsByName("main")[0] gives me a handle to 'main' but i cant get access to the page that's currently loaded in it..

i tried --> document.getElementsByName("main")[0].document.body but that's refering to the contents of THIS page with the two frames in it..

can anyone help?
shades
 
Why not:

Code:
document.frames['main'].document.body

*cLFlaVA
----------------------------
"Holy crip he's a crapple!
 
document.frames['main'].document.body returns undefined.. i think there's a security issue that prevents one frame from accessing objects in another maybe..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top