Asp版判断来路,实现自动跳转

Asp版


 程序代码

<%
if instr(Request.ServerVariables(”http_referer”),”baidu.com”)>0 then
response.redirect(”http://www.epofcn.com”)
end if
%>

 

Js版


 程序代码

<script>
function t(){
  //调试用alert(document.referrer)
  if (document.referrer&&document.referrer.indexOf(’baidu.com’)>=0){
    if(parent.window.opener) parent.window.opener.location=’http://www.epofcn.com’; //刷父窗口
    //输出提示信息document.getElementById(’tips’).innerText=’2秒后跳转到广告页’;
    //定时跳转setTimeout(’navigate(”http://www.epofcn.com”)’,2000);
  }
}
</script>
<body onload=”t()”>
<div id=”tips”></div><!-提示显示区–>
</body>

你可能感兴趣的:(asp)