中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Meta httpEquiv 屬性

Meta 對(duì)象參考手冊(cè) Meta 對(duì)象

定義和用法

httpEquiv 屬性可設(shè)置或者返回 content 屬性中HTTP 頭部信息。

http-equiv 屬性可以使用偽裝 HTTP 響應(yīng)頭部信息。

http-equiv 屬性值依賴 content屬性的值。

注意:如果 name 屬性已設(shè)置, http-equiv 屬性就無(wú)需設(shè)置。

語(yǔ)法

設(shè)置 httpEquiv 屬性:

linkObject.httpEquiv="HTTP-header"

返回 httpEquiv 屬性:

linkObject.httpEquiv

一些常用的 HTTP-header 值:

描述
cache-control 控制文檔的緩存機(jī)制。

允許的值:

  • public - 所有內(nèi)容都將被緩存(客戶端和代理服務(wù)器都可緩存)
  • private - 內(nèi)容只緩存到私有緩存中(僅客戶端可以緩存,代理服務(wù)器不可緩存)
  • no-cache - 不緩存
  • no-store - 緩存當(dāng)不歸檔 but not archived

實(shí)例:

<meta http-equiv="cache-control" content="no-cache">

content-language 響應(yīng)體的語(yǔ)言

實(shí)例:

<meta http-equiv="content-language" content="en-US">

content-type 返回內(nèi)容的MIME類型

提示: 通常用于字符集的設(shè)置。

實(shí)例:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

date 原始服務(wù)器消息發(fā)出的時(shí)間

實(shí)例:

<meta http-equiv="date" content="Wed, 16 Feb 2011 22:34:13 GMT">

expires 響應(yīng)過(guò)期的日期和時(shí)間

實(shí)例:

<meta http-equiv="expires" content="Fri, 30 Dec 2011 12:00:00 GMT">

last-modified 請(qǐng)求資源的最后修改時(shí)間

實(shí)例:

<meta http-equiv="last-modified" content="Mon, 03 Jan 2011 17:45:57 GMT">

location 用來(lái)重定向接收方到非請(qǐng)求URL的位置來(lái)完成請(qǐng)求或標(biāo)識(shí)新的資源

實(shí)例:

<meta http-equiv="location" content="URL=">

refresh 定義間隔多久后刷新頁(yè)面。

實(shí)例:

<meta http-equiv="refresh" content="300">

set-cookie 創(chuàng)建一個(gè) cookie ,包含了 cookie 名,cookie 值,過(guò)期時(shí)間。

實(shí)例:

<meta http-equiv="set-cookie" content="jsoncookie=myContent;expires=Fri, 30 Dec 2015 12:00:00 GMT; path=">

window-target 指定要載入的框架名

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 httpEquiv 屬性


實(shí)例

實(shí)例

顯示 HTTP 頭部信息:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
function displayResult(){
????var x=document.getElementsByTagName("meta")[0].httpEquiv;
????alert(x);
}
</script>
</head>
<body>

<button type="button" onclick="displayResult()">顯示 HTTP-Equiv</button>

</body>
</html>

運(yùn)行代碼 ?

Meta 對(duì)象參考手冊(cè) Meta 對(duì)象其他擴(kuò)展