js是实现页面倒计时跳转
2011-03-19 14:04
776 查看
整个Html页面代码如下,自己看吧:
<!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>易宝搜索</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 = 'query.jsp';
} else
{
if (navigator.appName.indexOf("Explorer") > -1)
{
document.getElementById('totalSecond').innerText = second--;
} else
{
document.getElementById('totalSecond').textContent = second--;
}
}
}
-->
</script>
</html>
<!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>易宝搜索</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 = 'query.jsp';
} else
{
if (navigator.appName.indexOf("Explorer") > -1)
{
document.getElementById('totalSecond').innerText = second--;
} else
{
document.getElementById('totalSecond').textContent = second--;
}
}
}
-->
</script>
</html>
相关文章推荐
- js实现页面跳转倒计时
- 【转】js倒计时并实现页面跳转
- js实现浏览器倒计时跳转页面效果
- js 实现5秒倒计时后跳转页面
- js 实现“倒计时” 以及 N秒后跳转页面
- js实现 页面显示系统时间(中文显示星期)、动态倒计时页面跳转
- JS实现倒计时三秒跳转后到新页面
- js实现倒计时跳转页面
- js实现几秒页面跳转的几种方式
- js重定向---实现页面跳转的几种方式
- js实现的跳转页面方法实现汇总
- js实现页面跳转的几种方式
- JS如何实现在页面上快速定位(锚点跳转问题)
- js实现页面跳转的几种方式 (实例)
- js实现页面跳转的五种方法推荐
- JS实现父页面跳转、iframe实现整页面跳转
- js实现页面的自动读秒跳转
- js实现页面跳转的几种方式
- JS如何实现点击页面内任意的链接均加参数跳转
- Js 实现页面跳转的几种方式