PDA

View Full Version : Getting a link in a popup to open in the window that opened the popup?


Thooms
03-21-2005, 10:41 AM
How do I get a link in a popup window (opened by a link), to open in the page that contained the link which opened the popup?

e.g.:

Page 1 contains a link to the Popup...
The Popup contains a link to Page 2...

How do I get Page 2 (opened from the link in the Popup), to open in Page 1's browser window?

The script used to open the mentioned popup is this:

<SCRIPT LANGUAGE="JavaScript">
<!--
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=320,height=450');");
}
// -->
</script>

.. And it's opened by this link in Page 1:

<a href="javascript:popUp('popup.htm')">Popup</a>

I can only get the link to open in either a new browser window or in the popup...

_Aerospace_Eng_
03-21-2005, 11:31 AM
it would be something like this
<a href="http://www.blah.com" onclick="opener.window.location='http://www.blah.com';return false">link</a>
that is how the link in popup.html should be formatted

Thooms
03-21-2005, 11:46 AM
Thanks, it works perfectly! :D