检测这个页面是从哪个页面转过来的,有些特殊作用

- 中国WEB开发者网络 (http://www.webasp.net)
-- 网页特效 (http://www.webasp.net/javascript/)
--- 检测这个页面是从哪个页面转过来的,有些特殊作用 (http://www.webasp.net/javascript/1/480.htm)
-- 发布日期: 2005-06-13
<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 1 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<SCRIPT>
<!--
function check(){ //remove this line to use the script for real
var from = document.referrer
var here = "http://www.jzzy.com/javascript/an22.htm" //Change this to your site
alert("From:"+from);//remove this line to use the script for real
alert("Here:"+here);//remove this line to use the script for real
if (from.substring(0,here.length) != here) history.back()
else document.location.replace('http://www.webasp.net/javascript/480.htm'); //Page to go to if OK
}//remove this line to use the script for real
//-->
</SCRIPT>
<FORM>
<INPUT TYPE=button VALUE="Check" onClick="check()">
</FORM>


webasp.net