Solved

popup

Posted on 2001-08-18
2
345 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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now