作为一个web开发人员,特别是在AJAX流行的时代,必须要熟悉这个http-equiv属性,这是w3school的一个参考表

Value Description
Allow Defines the methods supported by the server
Content-Encoding Defines additional content-encoding for the document
Content-Length Defines the size of the document (in bytes)
Content-Type Defines the MIME type of the document (like text/html)
Date Defines when the document was created
Expires Defines when the document will be considered obsolete
Last-Modified Defines when the document was last modified
Location Defines an absolute URL for the document
Refresh Defines a time interval for the document to refresh itself
Set-Cookie Defines a cookie-value
WWW-Authenticate Defines authentication rules returned by the server

对于开发人员最实用的小技巧

1. 设置页面的自动刷新时间或者自动跳转时间

例如:著名的struts2的blank example就使用了这个小技巧,进行index页面的跳转

<META HTTP-EQUIV=”Refresh” CONTENT=”0;URL=example/HelloWorld.action”>

2. 关于页面缓存的设置

<meta http-equiv=”pragma” content=”no-cache”>

禁止浏览器访问本机缓存的页面,这对于AJAX应用程序的调试来说绝对需要

<meta http-equiv=”expires” content=”Thu, 29 Nov 2007 16:18:42 GMT”>

设置页面的过期时间,所以设置一个过去的值当然页面一直是过期的,那就要求浏览器再去请求服务端的页面

3. 编码

<meta   http-equiv=”Content-Type”   content=”text/html;   charset=UTF-8″>

其他一些小花稍的功能

如:页面进入和退出的特效 (貌似IE支持,FF不支持,其余浏览器未测试)
<meta http-equiv=”Page-Enter” content=”revealTrans(duration=seconds, transition=type)”>
<meta http-equiv=”Page-Exit” content=”revealTrans(duration=x, transition=type)”>
这个是页面被载入和调出时的一些特效。duration表示特效的持续时间,以秒为单位。transition表示使用哪种特效,取值为1-23:
0 矩形缩小
1 矩形扩大
2 圆形缩小
3 圆形扩大
4 下到上刷新
5 上到下刷新
6 左到右刷新
7 右到左刷新
8 竖百叶窗
9 横百叶窗
10 错位横百叶窗
11 错位竖百叶窗
12 点扩散
13 左右到中间刷新
14 中间到左右刷新
15 中间到上下
16 上下到中间
17 右下到左上
18 右上到左下
19 左上到右下
20 左下到右上
21 横条
22 竖条
23 以上22种随机选择一种

参考:

http://www.w3schools.com/TAGS/att_meta_http_equiv.asp