Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: How do I call a call a script in one frame from another?


Message #1 by "Justin Pease" <jpease@k...> on Wed, 8 Nov 2000 17:15:35 -0700
Somthing like this

The "index.html" frame page:

<html>
<frameset rows=35%,*,35% frameborder="0">
  <frame src="yellow.html" name="a">
  <frame src="change.html" name="b">
  <frame src="yellow.html" name="c">
 </frameset>
</html>


The "change.html" page who cals another page:

<html>
 <head>
  <script language="javascript">
<!--
function Switch(frame1, frame2)
{
top.frames["a"].location = frame1;
top.frames["c"].location = frame2;
}
// -->
  </script>
 </head>
 <body>
<a href="#" onclick="Switch('blue.html','red.html')">Call frame</a>
</body>
</html>


An then you need 3 more, red.html, blue.html and yellow.html.


That's it!

Regards
    Bjarni

----- Original Message -----
From: Justin Pease <jpease@k...>
Newsgroups: javascript
To: javascript <javascript@p...>
Sent: Thursday, November 09, 2000 12:15 AM
Subject: [javascript] How do I call a call a script in one frame from
another?


> I have a page with frames because I want to keep a variable despite a
screen
> refresh.  But, how do I call my scripts since they are in the other frame?
>
> Thanks.  Sorry if it is a dumb question.
>
> J
>
>

  Return to Index