<meta>标签的使用

页面定期刷新,如果加url的,则会重新定向到指定的网页,content后面跟的是时间(单位秒),把这句话加到指定网页的<head></head>里
一般也用在实时性很强的应用中,需要定期刷新的
如新闻页面,论坛等,不过一般不会用这个,都用新的技术比如ajax等

<meta http-equiv="refresh" content="0; url=">'经过一段时间转到另外某个页面
content="0;URL=",这里0表示没有延时,直接跳转到后面的URL;把0改成1,则延时1秒后跳转。

网页自动计时跳转
这个页面跳转的好处在于不需要JS调用,直接在html文件头里加入
<meta http-equiv="refresh[刷新-这里指定动作]" content="5[这里是时间];url=/article[这里是跳转的URL]">
当某个页面需要自动跳转的时候就要用到这个代码,比如一般的网站广告页面打开几秒后自动跳转到另外一个页面去就是用这个代码实现的(当然用js也是可以实现的)
 
例如:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<c:if test= "${network eq 'in'}">
     <c:choose >
           <c:when test= "${user.user_type eq 'a'}">
               <meta http-equiv="refresh" content="0; URL=<%=cssPathIn%> ">
           </c:when>
           <c:otherwise>
               <meta http-equiv="refresh" content="0; URL=<%=hraPathIn%> ">
           </c:otherwise>
     </c:choose >
</c:if>
<c:if test= "${network eq 'out'}">
<c:choose>
           <c:when test= "${user.user_type eq 'a'}">
               <meta http-equiv="refresh" content="0; URL=<%=cssPathOut%> ">
           </c:when>
           <c:otherwise>
               <meta http-equiv="refresh" content="0; URL=<%=hraPathOut%> ">
           </c:otherwise>
     </c:choose >
</c:if>

<title> Index</ title>
</head>
<body>
</body>
</html>
原文地址:https://www.cnblogs.com/shilin000/p/4759699.html