• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

window.opener='x'

 
Steve Mutonshi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw some code looks like

window.opener='x';

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

thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic