<body>
<table align="center" width="400" cellpadding="10" border="0" style="text-align:center; margin:0 auto; margin-top:100px; border:#FF6600 1px solid; font-family : Arial;font-size : 11px;color : #656565;" >
<tr>
<td width="50" rowspan="3" valign="top" >
<a href="javascript:history.go(-1)"><span id="spanSeconds">10</span>seconds</a>
</td>
</tr>
<tr>
<td id="redirectionMsg" align="left">
error message
</td>
</tr>
</table>
<script language="JavaScript">
//等待多长时间跳转
var seconds = 10;
//这就是自动跳转的页面地址 默认我写成javascript:history.go(-1) 也可以写别的地址如2.html
var defaultUrl = "javascript:history.go(-1)";
onload = function()
{
if (defaultUrl == 'javascript:history.go(-1)' && window.history.length == 0)
{
document.getElementById('redirectionMsg').innerHTML = '';
return;
}
window.setInterval(redirection, 1000);
}
function redirection()
{
if (seconds <= 0)
{
window.clearInterval();
return;
}
seconds --;
document.getElementById('spanSeconds').innerHTML = seconds;
if (seconds == 0)
{
window.clearInterval();
location.href = defaultUrl;
}
}
</script>
</body>
错误提示页面自动返回上一页
最新推荐文章于 2022-11-03 18:30:18 发布