首页 实用教程
两种网页自动跳转的方法
发布时间:2024年04月02日 评论数:抢沙发 阅读数:396
一、html的实现
<head>
<!-- 以下方式只是刷新不跳转到其他页面 -->
<meta http-equiv="refresh" content="10">
<!-- 以下方式定时转到其他页面 -->
<meta http-equiv="refresh" content="5;url=https://www.wuxiaolei.com">
</head>
以上表示5秒后跳转到https://www.wuxiaolei.com
二、javascript的实现
<script language="javascript" type="text/javascript">
// 以下方式直接跳转
window.location.href='hello.html';
// 以下方式定时跳转
setTimeout("javascript:location.href='hello.html'", 5000);
</script>