大部分客户都使用的是asp,或其它的语言,现提供三个javascript脚本语言编写小程序,可以在多种php或asp中加入使用,也可以加在htm中,这里不介绍如何加下面代码加入到php或asp中,只说明如何加到html中。
将如下代码加入到index.htm文件的<head>中,就可以使用。
注:如果客户多个网站做指向,请添写多条判断,建议客户建一个function,每一个以return返回,避免一次性执行多个function出现问题,以下代码只是提供客户参考。
一:(非隐藏指向实现)
1)
<head>
<script>
if(window.location=="客户完整的网页地址:如(http://www.35.com或35.com,这里没做控制,如果两种方式,请做两条或由客户自己写其判断")
document.write('<html><meta http-equiv="refresh" content="0; url=客户要指向的目标网址"></html>')
</script>
</head>
2)
<head>
<script>
if(window.location=="客户完整的网页地址:如(http://www.35.com或35.com,这里没做控制,如果两种方式,请做两条或由客户自己写其判断")
window.navigate("客户要指向的目标网址")
</script>
</head>
二:(隐藏指向代码)
<head>
<script>
if(window.location=="客户完整的网页地址:如(http://www.35.com或35.com,这里没做控制,如果两种方式,请做两条或由客户自己写其判断")
document.write('<html><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><frameset frameborder=0 framespacing=0 border=0 rows="100%,*" noresize><frame name="frame" src="客户要指向的目标网址" noresize></frameset></html>')
</script>
</head>