[Javascript] opener object

Rodney Myers rodney at aflyingstart.net
Mon Jul 2 04:16:07 CDT 2001


Try this:

onclick="goPage('new_wd.htm')"

and
 function goPage(src)     ( in the popup code script tag)
{
if(self.opener)
    {
   self.opener.focus();   self.opener.location.href = src;
   self.close();
  }
}

If the page is tested in the browser without having been popped open
then the window (self) will not have an opener property.

hth

Rodney


Bill Marriott wrote:

>  Hi Everyone, I'm new to the list so please let me know if I don't
> follow the list etiquette.I'm also new to Javascript and have the
> following problem. I have a popup window I want to use to let the user
> select the next page for the parent window.
> On the 'on click' of a table cell in the popup , I want the popup to
> close
> and the parent window to go to the new address.
>
> I can't get the following code to work.
> Can anyone see why , Please?
>
> function goPage(src)     ( in the popup code script tag)
> {
>    opener.focus();   opener.location.href = src;
>    top.window.close();
> }
>
> onclick="javascript:return goPage('new_wd.htm')"  is the code in popup
> that calls the function. I'm getting an error " opener is not an
> object" Thanks in advance Bill

--
Shop at ssistant Add-ons and Developer Workshops
http://www.aflyingstart.net/addons/

Enquiries regarding Shop at ssistant Classic training :
Call 01256 880770

Rodney Myers
Based in Oxford, England
Technical Director, Shop at ssistant eCommerce Solutions






More information about the Javascript mailing list