Passing properties from parent window to child
(send variable to child window)
(pick up variable from parent window and drop it into the link's URL)
This might seem like a crazy way of doing things but it's totally neccasery in the project I'm working on for various reasons.
Not sure if its a variable it needs but either way it needs to be in the js somewhere in the parent and the child needs to read it within the link. Everywhere I've looked on the internet shows how to do this with forms etc but I can't make it work for a URL.
Both pages are on the same domain, same directory in fact.
I see where the confusion is as I've just used google as an example of the link. Let me be more specific...
Parent page - index1.html
Parent page produces popup as child - index2.html
Child page - index2.html
Child (index2.html) picks up the variable from parent (index1.html) and displays it in a link <a href="(variable_name_from_index1.html)">click</a>
Is that a bit clearer?
Thus, the URL of the parent, seeing from the popup, should be:
var parentURL = opener.location.href
Thanks for this.
Problem isn't producing the popup as a child as I've done that and I'm using window.opener to talk to the parent from the child, etc. What it is: I can't work out how to get a variable from the parent page into a link in the child page.
If parent page has:
How do I get this into the link into the child page so it would read:
<a href="variable_name">click</a> - this link would go to index3.html as that is what is specified in the variable name in the parent page.
if that variable is a global one.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)