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!

Passing Events 1

Status
Not open for further replies.

greyone

Programmer
Dec 14, 2000
200
CA
How do i pass events from one frame to another?
 
Here is an example of capturing an event in frame2 from frame 1... top.frame2.onload = load_function;
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
you can access variables in other frames:

parent.frames[1].varname;

you can call functions in other frames..

parent.frames[1].function();

or you can pass the parameters along when you load a new page in a frame..
<a href=&quot;page.htm?key=value&amp;okey=value&quot; target=&quot;main&quot;>link</a>
then get the data passed to it:

keys = new Array();
values = new Array();

data = location.search;
dataarray = data.split(&quot;&amp;&quot;);

for(i = 0; i < dataarray.length; i++)
{
tmp = dataarray.split(&quot;=&quot;);
keys[keys.length] = tmp[0];
values[values.length] = tmp[1];
}

now values[0] will hold the value of keys[0].

as for events, i'm not sure how to pass events from frame to frame.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top