This article for you in detail how to achieve through JS to wait for a specified time after the automatic jump or close the current page footsteps code, interested friends can refer to ha, I hope to help you
copy code code as follows:
//After a specified time jump
<script language= "javascript" >
function Go () {//define function
window.location= ' main.html ' ;//page Jump
}
Window.settimeout ("Go ()", 1000);//1 seconds after function go
</script>
//Specify time after automatic shutdown
<script typ E= "Text/javascript" >
function Closemywindow () {
Window.settimeout ("Window.close ()", 1000);
}
</script>
<body>
<div>
<!--Chrome ie is valid, Firefox invalid-->
<input type = "button" value= "Return Closemywindow ()" onclick= "Return Closemywindow ()"/>
<br/>
<!--Chrome IE is valid , Firefox is invalid-->
<input type= "button" value= "onclick=" Closemywindow () "onclick=" Closemywindow () "/>
<br/>
<!--ie valid, Firefox invalid-->
<a href= "#" onclick= "Closemywindow ()" > ' Closemywindow () ' </ A>
<br/>
<!--Chrome ie is valid, Firefox is invalid-->
<a href= "onclick=" Window.close () ">" Window.close () ' </a>
<br/>
</div>
</body>