JavaScript 參考手冊
httpEquiv 屬性可設置或者返回 content 屬性中HTTP 頭部信息。
http-equiv 屬性可以使用偽裝 HTTP 響應頭部信息。
http-equiv 屬性值依賴 content屬性的值。
注意:如果 name 屬性已設置, http-equiv 屬性就無需設置。
設置 httpEquiv 屬性:
返回 httpEquiv 屬性:
一些常用的 HTTP-header 值:
值 | 描述 |
---|---|
cache-control | 控制文檔的緩存機制。
允許的值:
實例: <meta http-equiv="cache-control" content="no-cache"> |
content-language | 響應體的語言
實例: <meta http-equiv="content-language" content="en-US"> |
content-type | 返回內容的MIME類型 提示: 通常用于字符集的設置。 實例: <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
date | 原始服務器消息發(fā)出的時間
實例: <meta http-equiv="date" content="Wed, 16 Feb 2011 22:34:13 GMT"> |
expires | 響應過期的日期和時間
實例: <meta http-equiv="expires" content="Fri, 30 Dec 2011 12:00:00 GMT"> |
last-modified | 請求資源的最后修改時間
實例: <meta http-equiv="last-modified" content="Mon, 03 Jan 2011 17:45:57 GMT"> |
location | 用來重定向接收方到非請求URL的位置來完成請求或標識新的資源
實例: <meta http-equiv="location" content="URL="> |
refresh | 定義間隔多久后刷新頁面。
實例: <meta http-equiv="refresh" content="300"> |
set-cookie | 創(chuàng)建一個 cookie ,包含了 cookie 名,cookie 值,過期時間。
實例: <meta http-equiv="set-cookie" content="jsoncookie=myContent;expires=Fri, 30 Dec 2015 12:00:00 GMT; path="> |
window-target | 指定要載入的框架名 |
所有主要瀏覽器都支持 httpEquiv 屬性
顯示 HTTP 頭部信息: