Solved

popup

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show confirmation alert in Jquery 14 41
Timerpicker in javascript 4 35
jQuery Syntax 2 47
Randomize in Owl Carousel v1.3.2 6 19
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now