A string that specifies the URL of the calling document.
想知道别人在看你的页面前是从哪Link过来的吗?用它吧。栗子:
first.htm内容:
<a href=aaa.htm>快按这里!</a>
second.htm内容:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
<input type="button" name="ComeFrom" value="ComeFrom" onclick="getReferrer()">
</form>
</body><script Language="JavaScript">
<!-- Begin
function getReferrer() {
alert(document.referrer);
}
// End -->
</script>
</html>从first.htm按下联接到的second.htm,可以在second.htm中知道。
想知道别人在看你的页面前是从哪Link过来的吗?用它吧。栗子:
first.htm内容:
<a href=aaa.htm>快按这里!</a>
second.htm内容:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
<input type="button" name="ComeFrom" value="ComeFrom" onclick="getReferrer()">
</form>
</body><script Language="JavaScript">
<!-- Begin
function getReferrer() {
alert(document.referrer);
}
// End -->
</script>
</html>从first.htm按下联接到的second.htm,可以在second.htm中知道。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货