网站404页面3秒后跳到首页的实例代码
2018-10-12 14:03
501 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>404 Not Found</title>
</head>
<body>
<h1>找不到指定的页面</h1>
<span id="totalSecond">3</span>秒后自动返回
</body>
<script language="javascript" type="text/javascript">
<!--
var second = document.getElementById('totalSecond').textContent;
if (navigator.appName.indexOf("Explorer") > -1) //判断是IE浏览器还是Firefox浏览器,采用相应措施取得秒数
{
second = document.getElementById('totalSecond').innerText;
} else
{
second = document.getElementById('totalSecond').textContent;
}
setInterval("redirect()", 1000); //每1秒钟调用redirect()方法一次
function redirect()
{
if (second < 0)
{
location.href = 'http://要跳转的网站';
} else
{
if (navigator.appName.indexOf("Explorer") > -1)
{
document.getElementById('totalSecond').innerText = second--;
} else
{
document.getElementById('totalSecond').textContent = second--;
}
}
}
-->
</script>
</html></td>
</tr>
</table>
您可能感兴趣的文章:
相关文章推荐
- 网站404页面3秒后跳到首页的实例代码
- 网站404页面3秒后跳到首页代码
- 404页面 3秒后跳到首页 实现
- <div+css页面布局课堂笔记>10---页面布局网站首页设计实例__2
- 一种基于自定义代码的asp.net网站首页根据IP自动跳转指定页面的方法!
- 一种基于自定义代码的asp.net网站首页根据IP自动跳转指定页面的方法!
- PHP实现定时生成HTML网站首页实例代码
- 一种基于自定义代码的asp.net网站首页根据IP自动跳转指定页面的方法!
- 网站只有首页能打开,其他页面404
- <div+css页面布局课堂笔记>9---页面布局网站首页设计实例__1
- UCHome 网站首页index.php页面代码分析
- <div+css页面布局课堂笔记>11---页面布局网站首页设计实例__终极版(仿csdn首页)
- nginx 404 403等错误信息页面重定向到网站首页或其它事先指定的页面
- 网站添加百度分享按钮代码实例
- 网站首页head区代码规范 xhtml文档类型
- jQuery中弹出iframe内嵌页面元素到父页面并全屏化的实例代码
- Asp.net MVC3 企业网站系统高仿博客园 首页左侧列表页面 实现效果
- 29讲项目实战:404页面制作+网站友情链接调用