JS Close Open Window


To open a windown in javascript:

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



close() method will close an open window:

var w = window.open("","","width=500, height=80");
w.document.write("Perschon.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.

convert.idontcarewhatyouthink.net © 2021  Terms of Use | Home