Link to home
Start Free TrialLog in
Avatar of Chasseur
Chasseur

asked on

popup


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.
Avatar of Y_ee
Y_ee

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
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial