<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
</head>
<body>
<!--先编写好网页布局-->
<h2>操作成功</h2>
<span id="second">5</span>
<span>秒后返回主页</span>
<a href="javascript:back();">返回</a>
<script type="text/javascript">
//获取显示秒数的元素,通过定时器来更改秒数。
var num=document.getElementById("second").innerHTML;
function count(){
num--;
if(num>0){
document.getElementById("second").innerHTML=num;
}
if(num==0){
location.assign("www.baidu.com");
}
}
setInterval("count()",1000);
//通过window的location和history对象来控制网页的跳转。
function back(){
window.history.back();
}
</script>
</body>
</html>
JS制作一个跳转提示页面
最新推荐文章于 2023-09-25 21:44:00 发布
1091

被折叠的 条评论
为什么被折叠?



