Passing data from Parent window to child window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • btreddy
    New Member
    • Oct 2008
    • 83

    Passing data from Parent window to child window

    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.op en(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.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    "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?

    Comment

    Working...