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

Simple JScript/Frames ?

Status
Not open for further replies.

sabev

Programmer
Sep 27, 2002
47
US
I have a simple frames page in which a frame called 'topframe' creates a new window. I would like the new window to be able to access functions from the calling frames.

In this case, frame name 'topframe' creates a new window and inserts new.htm in it. I would like new.htm to change the color of the frame named 'left'. I just can't get the heiarchy correct.

See the ChangeColor() function in the last script

Thanks Doug

mainframe.htm -

<HTML>
<head>
</head>
<FRAMESET frame=&quot;pframe&quot; COLS=&quot;15%,15%,*&quot;>
<FRAME SRC=&quot;left.htm&quot; name=&quot;left&quot;>
<frameset name=&quot;cframe&quot; rows=&quot;50%,*&quot;>
<FRAME SRC=&quot;top.htm&quot; name=&quot;topframe&quot;>
<FRAME SRC=&quot;bottom.htm&quot; name=&quot;bottom&quot;>
</FRAMESET>
<FRAME SRC=&quot;right.htm&quot; name=&quot;right&quot;>
</FRAMESET>


top.htm -

<HTML>
<body>
<script type=&quot;text/javascript&quot; language=&quot;javascript&quot;>
function CheckTheme(theme)
{
QueryWindow = window.open(&quot;new.htm&quot;)
}
</script>
<body>
<a href=&quot;javascript:CheckTheme();&quot;>New Window</a>
</BODY>
</HTML>

new.htm

<HTML>
<head>
</head>
<script type=&quot;text/javascript&quot; language=&quot;javascript&quot;>
function ChangeColor()
{
parent.parent.left.document.bgColor=&quot;violet&quot;// <--
}
</script>
<body>
<a href=&quot;javascript:CheckTheme();&quot;>Violet Calling window</a>
</body>
</html>
 
opener.parent.left.document.bgColor=&quot;violet&quot;

Adam
 
Thanks Adam,

That did it, I'm just starting with JScript and obviously have missed some things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top