[Javascript] opener object

Peter Brunone peter at brunone.com
Mon Jul 2 15:47:01 CDT 2001


RE: [Javascript] Table within a table?Bill,

    What's your code that opens the window?  If you don't explicitly set the opener property, you might want to go ahead and do that, e.g.

var newWin = window.open(all that stuff);
if(!newWin.opener) {
    newWin.opener = window;
    }

    You might also try referring to the parent window as window.parent (from the child window); I haven't tried that, but it's worth a shot.

Cheers,

Peter
  ----- Original Message ----- 
  From: Bill Marriott 
  To: javascript at LaTech.edu 
  Sent: Monday, July 02, 2001 3:33 PM
  Subject: [Javascript] opener object


  Hi Everyone,

  I'm new to the list so please let me know if I don't follow the list etiquette.
  I'm also relatively 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 to go to.
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010702/7a248df2/attachment.htm>


More information about the Javascript mailing list