实现自动HTML刷新页面和跳转页方法有很多,主要分为两类,一类为使用html head标签,另一类为使用js强制刷新或跳转。
1. 使用js 刷新当前页面,3秒执行一次。
<script language="JavaScript">
function Refresh()
{
window.location.reload();
}
setTimeout('Refresh()',3000); //3秒刷新一次
</script>
2. 使用js 自动跳转页面,3秒后执行
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript">
function goUrl()
{
var url="http://blog.csdn.net/haoaiqian";
location.href=url;
}
</script>
</head>
<body onload="setTimeout('goUrl()', 3000);">
</body>
</html>