<!DOCTYPE html>
<html>
<head>
<title>Browser Object</title>
<!-- Jump to the home page at the specified time in the error page through JS-->
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
</head>
<body>
<!--Write the page layout first-->
<h3>Successful operation</h3>
<p>
Return to home page after <b id="second">5</b> seconds <a href="javascript:goBack();">back</a>
</p>
<script type="text/javascript">
//Get the element that displays the seconds, and use the timer to change the seconds.
var sec = document.getElementById("second");
var i = 5;
var timer = setInterval (function () {
i--;
sec.innerHTML = i;
if(i ==1){
window.location.href="http://baidu.com";
}
},1000)
/ / Control the jump of the web page through the location and history objects of the window.
function goBack(){
window.history.go(-1);
}
</script>
</body>
</html>