HTML DOM rev 属性
定义和用法
rev属性设置或返回目标URL和当前文档之间的关系。
rel和rev属性协同工作。搜索引擎使用这两个属性来提供链接的导航菜单。
语法
linkObject.rev=relationship
rev属性可以具有以下值之一:
值 | 描述 |
---|---|
appendix | Link to the appendix page of the document(链接到文档的附录页面) |
alternate | Link to an alternative source of the document(链接到文档的其他来源) |
bookmark | Link to a bookmark(链接到书签) |
chapter | Link to a chapter(链接到章节) |
contents | Link to the table of contents of the document(链接到文档目录) |
copyright | Link to copyright or the policy of the document(链接到文档的版权或策略) |
glossary | Link to the glossary page of the document(指向文档词汇表页面的链接) |
index | Link to the index page of the document(链接到文档的索引页) |
next | Link to the next page(链接到下一页) |
prev | Link to the previous page(链接到上一页) |
section | Link to a section in a list of documents(链接到文档列表中的某个部分) |
start | Link to the first page (used by search engines to show the first page)(链接到首页(搜索引擎使用它来显示首页)) |
stylesheet | Link to the style sheet of the document(链接到文档的样式表) |
subsection | Link to a sub-section in a list of current documents(链接至当前文档列表中的小节) |
实例
以下示例返回目标URL和当前文档之间的关系:
<html> <head> <link rev="subsection" id="link1" href="/htmldom/prop_link_rev.asp" /> </head> <body> <script type="text/javascript"> x=document.getElementById("link1"); document.write("Reverse relationship: " + x.rev); document.write("<br />This page is a subsection of: "); document.write(x.href); </script> </body> </html>