Blogger Information
Blog 4
fans 0
comment 1
visits 4261
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
http-equiv属性详解
CHEN
Original
2030 people have browsed it

一、http-equiv理解

1.http-equiv,可以被称作http响应头、http文件头,当浏览器请求某个文件时,首先会加载此响应(文件)头内的设置。

2.http-equiv和content属性名称/值对,当服务器向浏览器发送文档时,会先发送这些名称/值对

二、http-equiv应用案例

< meta http-equiv=“名” content=“值”>

< !–1.禁止浏览器从本地机的缓存中调阅页面内容,设定后一旦离开网页就无法从Cache中再调出 -->

<meta http-equiv="pragma" content="no-cache">1

< !–2.清除缓存(再访问这个网站要重新下载!)–>

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

< !–3.设定网页的到期时间,一旦网页过期,必须到服务器上重新传输。–>

<meta http-equiv="expires" content="0">
<meta http-equiv="expires" content="Wed, 13 Jun 2017 22:33:00 GMT">12

< !–4.关键字,搜索引擎用–>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">1

< !–5.页面描述–>

<meta http-equiv="description" content="This is my page">1

< !–6.html+utf-8–>

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

< !–7.几秒后页面自动跳转–>

案例中2指’2秒’,如果不写URL,默认为刷新当前页面,则效果为每隔多少秒刷新一次当前页面

<meta http-equiv="Refresh" content="2;URL=http://www.net.cn/">
<meta http-equiv="refresh" content="30">12

< !–8.Set-Cookie如果网页过期,那么存盘的cookie将被删除–>

<meta http-equiv="Set-Cookie" content="cookievalue=xxx;expires=Wednesday, 20-Jun-200722:33:00 GMT; path=/">


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post