- 用meta进行页面重定向:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Refresh" content="5;url=http://www.w3school.com.cn" />
</head>
<body>
<p>
对不起。我们已经搬家了。您的 URL 是 <a href="http://www.w3school.com.cn">http://www.w3school.com.cn</a>
</p>
<p>您将在 5 秒内被重定向到新的地址。</p>
<p>如果超过 5 秒后您仍然看到本消息,请点击上面的链接。</p>
</body>
</html>
<ul><li>//用javascript获取meta的content属性值</li><li><html>
<head>
<meta name="keywords" content="HTML, DHTML, CSS, XHTML, JavaScript" />
</head>
<body>
<script type="text/javascript">
x=document.getElementsByTagName("meta")[0];
document.write("Meta content: " + x.content);
</script>
</body>
</html>
</li></ul><div>
</div><div>3、查看httpEquiv</div><div><pre style="margin-top: 10px; margin-bottom: 0px; padding: 10px; border: 1px dotted rgb(119, 136, 85); font-family: Consolas, 'Courier New', Courier, monospace; width: 685px; background: rgb(245, 245, 245);"><html>
<head>
<meta http-equiv="refresh" content="5" />
</head>
<body>
<script type="text/javascript">
x=document.getElementsByTagName("meta")[0];
document.write("Http equiv: " + <code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, 'Courier New', Courier, monospace; color: rgb(0, 0, 221);">x.httpEquiv</code>);
</script>
</body>
</html>
1. <meta name="Description"content="信息参数"/> 代表说明网站的主要内容,概况是什么
2. <meta name="generator"content="信息参数"/>
代表说明网站的采用的什么软件制作
3. <meta name="author"content="信息参数">
代表说明网页版权作者信息
4. <meta name="COPYRIGHT" content="信息参数">
meta标签的COPYRIGHT的信息参数,代表说明网站版权信息。
5.<meta name="Robots"contect="信息参数">
Robots代表告诉搜索引擎机器人抓取哪些页面
4. <meta http-equiv="Refresh"Content="时间;Url=网址参数">
meta标签的Refresh代表多少时间网页自动刷新,加上Url中的网址参数就代表,多长时间自动链接其他网址。
5. <meta http-equiv="Content-Type"content="text/html;charset=信息参数"/>
charset的信息参数如GB2312时,代表说明网站是采用的编码是简体中文;
6.<meta http-equiv="imagetoolbar"content="false"/>
指定是否显示图片工具栏,当为false代表不显示,当为true代表显示。
.<meta http-equiv="Content-Script-Type" content="text/javascript"> W3C网页规范,指明页面中脚本的类型。
8.<meta http-equiv="pragma" content="no-cache">
代表禁止浏览器从本地计算机的缓存中访问页面内容,这样设定,访问者将无法脱机浏览。
9.<meta name="revisit-after" content="7days">
revisit-after代表网站重访,7days代表7天,依此类推
10.<meta http-equiv="X-UA-Compatible" content="IE=edge">对IE8新增的设置,页面采用edge进行渲染,防止在IE8下表现不正常
11 <meta content="telephone=no,email=no" name="format-detection" />
规定页面是否进行格式检测
12. <meta name="renderer" content="webkit">
优先用哪种浏览器内核渲染页面
本文详细介绍了如何使用HTML的meta标签进行页面重定向,并展示了如何通过JavaScript获取meta标签的内容属性值。此外,文章还阐述了不同meta标签属性的作用,包括元信息的类型、编码方式、搜索引擎爬虫行为控制等。
1362

被折叠的 条评论
为什么被折叠?



