close() closes the window
usage:
window.close(); //Close this window
or
<window object>.close(); //Close the specified window
For example: close the newly created window.
<script type="text/javascript">
var mywin=window.open('http://www.xxx.com'); //Store the newly opened window object in the variable mywin
mywin.close();
</script>
Note: The above code closes the window while opening a new window, and the opened window cannot be seen.