JS Close Open Window


To open a windown in javascript:

var w = window.open("","","width=500, height=80");
w.document.write("EndMemo.com javascript Tutorial");



close() method will close an open window:

var w = window.open("","","width=500, height=80");
w.document.write("EndMemo.com javascript Tutorial");
w.close();


Although the open window has a close button on the up right corner.

If no open window is specified, by default it will close current web page:

window.close();


However, in firefox, if current page is not opened by javascript, it will not close it.

endmemo.com © 2024  | Terms of Use | Privacy | Home