Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Load New Page In Parent / Close Popup Window

Posted on 2001-07-10
Medium Priority
Last Modified: 2008-02-26
I've added the following script to a popup window that's opened when a link in it's parent is clicked:

   function OpenInMain(mainurl) {

with the following link:

<A HREF="javascript:OpenInMain('')" onClick="window.close();">New Site</A>

This loads a new page in the parent window, but it won't close the popup window. How can I do that at the same time?
Question by:lhutton
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 15

Accepted Solution

a.marsh earned 200 total points
ID: 6271268
Change the function to this:

  function OpenInMain(mainurl) {

and change the link to:

<A HREF="javascript: OpenInMain('');">New Site</A>



Author Comment

ID: 6271311
Ah! I tried window.close(); in the script but didn't even think of using window.opener.focus(); as well!

Cheers :)
LVL 15

Expert Comment

ID: 6272082
Glad to help. :o)


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one 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…

721 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