方法一:
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta http-equiv="refresh" content="5;URl=http://www.baidu.com">
</head>
<script>
function goTo(url){
window.location.href=url;
}
setTimeout("goTo('http://www.baidu.com')",5000);
</script>技术要点:http:// 一定要加上,否则无法完成跳转。
本文介绍了两种实现网页自动跳转的技术方案。第一种是通过HTML的meta标签设置刷新时间及目标URL;第二种则是利用JavaScript定时器配合window.location.href属性来完成跳转。这两种方法均可实现在指定时间后将用户引导至新的页面。
2153

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



