Click to See Complete Forum and Search --> : popup changes parent


Larry
10-21-2003, 06:50 PM
We us alot of popup for learning and would like to place a link on the popup window that changes the window that launched it.

We do not use frames,

any help would be appreciated..

Jona
10-21-2003, 06:54 PM
In the popup window...


opener.location.href="page.html";


You can use "opener" to refer to the window that opened it.

[J]ona

Larry
10-21-2003, 07:30 PM
I just do not know how to impliment that..
The popup launches an html page.

I've tried many variations here is another that does not work

<opener.location.href="design.htm">try this should move the part frame </a>

????

Stumped

Jona
10-21-2003, 07:32 PM
In the HEAD of the popup window HTML file...


<script type="text/javascript"><!--
opener.location.href="the_page_you_want_the_parent_to_open_in.html";
//--></script>


[J]ona

Larry
10-21-2003, 08:40 PM
we have been at this so long, I really apopreciate you help.
here is an example, what are we missing?

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<script type="text/javascript"><!--opener.location.href="designer.htm";//--></script>


</head>

<body>

<p>
<script language=javascript>
<!--opener.location.href="designer.htm";//--></script>


<a href="designer.htm;" >try this one</a>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="classes.htm">this is two</a></p>

</body>

</html>

Jona
10-21-2003, 09:11 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN"
&nbsp; "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head><title>New Page 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script type="text/javascript"><!--
opener.location.href="designer.htm";
//--></script>
</head>
<body>
<p>
<a href="designer.htm" target="_parent">Designer page</a>
<br><br><br></p>
<p><a href="classes.htm" target="_parent">Classes page</a></p>
</body></html>


[J]ona

Larry
10-21-2003, 10:30 PM
What this seems to do is change what is in the popup window.

we want to change the window that launched it.

Say you are on learning.htm click on brushes and a popupwindow opens with all of the instructions on brushes.

From that popup window we would like to have a link that when clicked the main window - learning.htm - the one that launched the popup window will go to another page. say buy the brush page buy.htm


while the popup window stays the same.

Jona. You are really great for helping us out. This has keep us up for a long time.

Thanks

Jona
10-22-2003, 01:42 PM
Open the window:


<a href="popup.html" onclick="window.open(this.href,'child','width=200,height=300'); return false;" target="child">Pop up</a>


Update the opener from the child:


<a href="learning.htm" onclick="opener.location.href=this.href; return false;" target="_parent">Learning (opens in parent)</a>


[J]ona