index.jsp:
<form action="news/result.jsp" method="post" >
<input type="submit" value='提交'>
</form>
result.jsp:
<span id="remainSeconds">3</span>
<span>秒后返回上一页</span>
result.js:
var remainSeconds = 3;
function back(){
remainSeconds--;
if(remainSeconds > 0){
document.getElementById('remainSeconds').innerHTML = remainSeconds;
setTimeout(this.back,1000);
}else{
window.history.back();
}
}
setTimeout(back,1000);