Solved

change url of parent window onclose

Posted on 2004-04-30
5
2,442 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
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:adilkhan
Comment Utility
opener.document.location = 'http://www.yahoo.com'
0
 
LVL 1

Author Comment

by:dsyn
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you soooo much... :)
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Oh! You are welcome :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

744 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

17 Experts available now in Live!

Get 1:1 Help Now