<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>定时器5秒自动跳转百度</title>
<script type="text/javascript">
function count(){
setTimeout("window.location.href='http://www.baidu.com'",5000);
}
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>定时器5秒自动跳转百度</title>
<script type="text/javascript">
function count(){
setTimeout("window.location.href='http://www.baidu.com'",5000);
}
这个HTML页面展示了如何使用JavaScript实现5秒钟后自动跳转到百度。通过`setTimeout`函数,点击按钮后页面将在5秒后重定向到百度首页。
订阅专栏 解锁全文
6万+

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



