JavaScript - close window (window.close)

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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326645436&siteId=291194637