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

Passing array from parent to iframe 1

Status
Not open for further replies.

ronnie98

Technical User
Aug 5, 2004
36
IT
Hi all,
i have a page (main.html) and an iframe loading another page (frame.html).
In main.html an array is loaded to replace some variables:
Code:
arrayname['key_one_name'] = 'First value';
arrayname['key_two_name'] = 'Second value';
and so on...
For some reason this array is not loaded into frame.html
so these values are not available there.
How can i pass the array to frame.hmtl page?
Thanks in advance.
 
>For some reason this array is not loaded into frame.html
Why should it?

To refer to it from the iframe, one way is to do it like this.
[tt] var x=window.parent.window.arrayname[key_one_name"];
var y=window.parent.window.arrayname.length;
//etc
[/tt]
 
Thank you tsuji,
one last thing:
how can i refer to the whole array at once?
 
>how can i refer to the whole array at once?
[tt] var z=window.parent.window.arrayname;[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top