aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes window.opener='x' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "window.opener= Watch "window.opener= New topic
Author

window.opener='x'

Steve Mutonshi
Greenhorn

Joined: Jun 13, 2008
Posts: 13
I saw some code looks like

window.opener='x';

what does this mean ? what is this 'x' ?

thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
'x' is a string
window.opener is normally the reference to the window that opens up a pop up window.

People used to run code sort of like that to trick the browser into letting the parent get closed. I could not tell you if that is the case here without seeing all of the code in that section.

Eric
Steve Mutonshi
Greenhorn

Joined: Jun 13, 2008
Posts: 13
Originally posted by Eric Pascarello:
'x' is a string
window.opener is normally the reference to the window that opens up a pop up window.

People used to run code sort of like that to trick the browser into letting the parent get closed. I could not tell you if that is the case here without seeing all of the code in that section.

Eric


Eric, you are right. I saw the following sample code for closing the window

window.opener='x';window.close();

Since I am not familiar with Javascript, I don't know if I can "copy" the same code without changing the syntax 'x' ? what I want to do is to close the window without getting a pop up warning msg.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: window.opener='x'