Solved

popup

Posted on 2001-08-18
2
348 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

821 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