在JavaScript中关闭窗口
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在JavaScript中关闭窗口相关的知识,希望对你有一定的参考价值。
The function that closes window is very useful when you use a pop-up window on your page, because it allows the visitor to easily close the window. You can also do it several ways: to use a button, a text link or make the window closes automatically after a given number of seconds.
<!-- Sample #1: form button --> <form> </form> <!-- Sample #2: text link --> <a href="javascript:window.close();">Click Here to Close Window</a> <!-- Sample #3: close window after a given number of seconds --> <body onload="setTimeout(window.close, 10000)">...</body>
以上是关于在JavaScript中关闭窗口的主要内容,如果未能解决你的问题,请参考以下文章
JavaScript 在Firefox和Internet Explorer中关闭窗口