Click to See Complete Forum and Search --> : Loading a page in a window that is already open


scottey
07-09-2003, 03:34 PM
Ok... It has been a while since I have been back for some of the best advice on the net... Here is my dilema...

I am opening a small popup window (no toolbars or anything), approx. 350x400. This window will have a bunch of text links on it. When you click one of the links the window automatically closes. I have all of this running ok.

Now I want to have the new page load in the first window that the user click on the link that made the popup open. Does this make sense?

So you open the page (will call this page1)... click on a link which opens a popup (called page2). You click on a link on page2... page2 closes automatically and the new page opens in page1.

Anyone have some ideas?

Scott

Charles
07-09-2003, 04:10 PM
The trick part is in keeping your site working for the 13% of people who do not use JavaSCript and for the countless throngs that block pop-ups. This will do the trick

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Page 1</title>
<div><a href="page2.html" onclick="window.open(this.href, 'child', 'height=350,width=400'); return false">W3C</a></div>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Page 2</title>
<div><a href="http://www.w3.org/" onclick="if (self.opener) {self.opener.location = this.href; self.close(); return false}">W3C</a></div>