Javascript Reference
Categories: window

javascript window close( )

@Nov. 25, 2009, 8:36 a.m.
close( ) Firefox/Netscape/NN 2 IE 3 Chrome/Safari/DOM n/a  

 

  

Closes the current window. A script in a subwindow cannot close the main window without receiving the user's explicit permission from a security dialog box. A window can close itself (i.e., from a script running in the same window) or a window it generated via the window.open( ) method.

Note:
Only window that opened by javascript or a URL can be closed by this method. window.close() doesn't work due to window.opener is null.
By javascript=window.open or window.showxxxxdialog
By a URL=has referrer

Suggestion:
if(!window.opener){
//hide your close button as it doesn't work.
}

 
Parameters

None.

 
Returned Value

None.


Powered by Linode.