Solved

change url of parent window onclose

Posted on 2004-04-30
5
2,449 Views
Last Modified: 2012-08-13
Hey, I have a pop-window that I would like to change the url of its parent when I close the pop-up.

this is what I have so far but it's not working:


<SCRIPT LANGUAGE="JavaScript">



function loadinparent(url, closeSelf){
      self.opener.location = url;
      if(closeSelf) self.close();
      }


</SCRIPT>


<BODY BGCOLOR=#FFFFFF background="images/bg.gif" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onUnLoad="loadinparent('location.html', true);">


help?
0
Comment
Question by:dsyn
[X]
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
  • 2
5 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 10960907
opener.document.location = 'http://www.yahoo.com'
0
 
LVL 1

Author Comment

by:dsyn
ID: 10960946
this didn't work:

<SCRIPT LANGUAGE="JavaScript">
function loadinparent()
{
      opener.document.location = 'http://www.yahoo.com'
      }

//-->
</SCRIPT>

<BODY BGCOLOR=#FFFFFF background="images/bg.gif" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onUnLoad="loadinparent();">

0
 
LVL 63

Accepted Solution

by:
Zvonko earned 125 total points
ID: 10961302
Check this:

<BODY BGCOLOR=#FFFFFF background="images/bg.gif" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onBeforeUnload="opener.location='http://www.yahoo.com';">




0
 
LVL 1

Author Comment

by:dsyn
ID: 10964204
Thank you soooo much... :)
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10964270
Oh! You are welcome :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Suggested Courses

623 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