Solved

popup

Posted on 2001-08-18
2
347 Views
Last Modified: 2006-11-17

I have a popup with a link on it. I need the popup to close when the link is activated and the new page to open in the parent window. It must be easier than it seems.
0
Comment
Question by:Chasseur
2 Comments
 
LVL 1

Expert Comment

by:Y_ee
ID: 6402670
OK try this

Main page:
<html>
<head>
     <title></title>
</head>
<body>
<a href="javascript:var oWin=window.open('pop.html','thePop')">pop it</a>
</body>
</html>

pop.html:

<html>
<head>
     <title></title>
    <script>
    onunload=function() {
        if (window.opener) window.opener.location='http:\/\/www.experts-exchange.com'
    }  
    </script>
</head>
<body>
<a href="javascript:window.close()">close</a>
</body>
</html>

ciao
Y
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 50 total points
ID: 6403290
Safer to do it all in the link since Netscape tend to forget things onunload

<a href="#"
onClick="
window.opener.location='http:\\www.experts-exchange.com';
window.close();
return false">change and close</a>

Michel
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question