By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,948 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,948 IT Pros & Developers. It's quick & easy.

Passing data from Parent window to child window

P: 83
Hii all..,

I have one query not able to find a solution.

I've one javascript page(parent)on which upon clicking one link it willopen one more page(child page).

here my question is how to set the value for a variable, which is there in the child window,once the user clicks on the link in parent window.

I tried this.

var child=window.open(child page info here);
child.variable_name="clicked for the first time";

*variabale_name is the variable declared in child page.

Requesting you all Kindly tell me how to do this one.

Thank you..

Rgds,
Tirumala.
Nov 30 '09 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
"child" probably won't be defined straight away. You will need to wait for the page/window to load. One way is to call a function onload (child) which calls a function in the parent. However, since you're setting a variable in the child window, can you not set it directly in the page when the page loads?
Nov 30 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.