PDA

Click to See Complete Forum and Search --> : Calling Javascript functions between frames


lenin
Nov 23rd, 2000, 06:57 AM
Hi,
is it possible to call a javascripts function in one frame to execute in another? I have been working ( read as struggling ) with a small project which has some borrowed js files (http://www.geocities.com/Paris/LeftBank/2178/ )containing javascript functions for a navigation system.

As expected if the user clicks on a node ( in the navigation frame ) it triggers an event in the javascript program to open / close the node, however, to make the navigation system consistent I want to be able to kick the events of from another frame ( the main frame ) in the browser.

This question is a continuation of the questions posted yesterday / day before.


The source below is in the main frame. I am presuming that this is executed in this ( the main )frame, but needs to be executed in the navigation frame. This is the crux f my question, how?

Thanks in advance

Lenin.


<head>
<script language="javascript" src="ftiens4.js"></script>
<LINK rel="stylesheet" type="text/css" href="../StyleSheets/RMC2.css">
</head>

<body>
<a href="../Regions/ListRegions.asp" onclick="javascript:clickonNode(1);"><img src="../regions/images/Readymix.gif" border="0"></a>
</body>

N*G*Evangelion
Nov 23rd, 2000, 07:48 AM
I think this would be the best way:

Have your ftiens4.js file included in your NAVIGATION html page.

Assuming you have named your navigation frame "nav", in your MAIN html page put this:
<a href="../Regions/ListRegions.asp" onClick="parent.nav.clickonNode()">
<img src="../regions/images/Readymix.gif" border="0">
</a>

I think that is what you are looking for.