一个专注于技术的IT男
[WebDev]有用的http-equiv属性
作为一个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种随机选择一种
参考:
| 打印文章 | 这篇文章由Jacky于2009/12/28 21:52发表在WebDev。你可以订阅RSS 2.0 也可以发表评论或引用到你的网站。 |



大约8月前
你现在位置中插入图片的插件有吗?用什么?
我试了几个都不爽..
大约8月前
我升级成了wordpress2.9默认的编辑器对图片上传和编辑支持的都不错,我就自己加了SyntaxHighligher这个代码插件