<script type="text/javascript">
        window.onload = function(){

            timeClosePageT=-1;
            function timeClosePage(t){

                timeClosePageT=t||-1;
                if(timeClosePageT!=-1)
                {
                    setTimeout(function() {
                        window.open('定时关闭.html');
                        window.close();
                    }, timeClosePageT);
                }
            }
            document.getElementById("timeClosePage").onclick = function(){
                timeClosePage(3000);

            }
        };
    </script>

window.close()函数不一定所有浏览器都支持,一般前面加一个window.open(本身html文件)。。。

setTimeout函数的应用。。。。。

这些小段代码没有太多细节问题,控制浏览器的页面用的就是这些封装,实属基础不多解释~