实现页面跳转
假设a.html和b.html在同一个文件夹下面,用javascript实现当打开a.html五秒钟后,自动跳转到b.html。
------解决方案--------------------可以在几个地方写代码
1、<body onload="setTimeout('form1.submit()',2000)">
<form action=b.htm method=post name=form1>
</form>
2、<META HTTP-EQUIV="Refresh" CONTENT="5;URL=b.html">
3、<script>
setTimeout('form1.submit()',2000);
</script>
同 1 一样 构建个form1
------解决方案--------------------setTimeout('location.href = b.html',5000);
------解决方案--------------------JScript code
<html>
<head>
<script language="javaScript">
function openUrl(){
window.open("test2.html");
}
function loadHtml(){
window.setTimeout("openUrl()",5000);
}
</script>
</head>
<body onload="loadHtml()">
</body>
</html>