document.title -> 标题
url -> 地址
lastModified -> 最后更新
防止盗链:
<head>
<script>
var currentURL = document.URL 当前
var fromURL = document.referrer 上一文档
if (fromURL != "")
{
var currentURLs = currentURL.Split("/"); //分割当前URL
var fromURLs = fromURL.Split("/"); //分割上一URL
if (currentURLs[2] = fromURLs[2])
document.write("不是盗链");
else {
document.write("是盗链");
history.location = "http://" + currentURLs[2];//转到主页
}
IE为document扩展了all属性,返回所有html元素。
var elementLength = document.all.length;
for (var i=0; i<elementLength; i++)
document.write(document.all[i].tagName);
查看网页上所有超链接:
for (i=0; i<document.links.length; i++)
{
document.write(document.links[i].href);
document.links[i] .target = "_blank";
}