FavoriteLoading
0

网页屏蔽部分城市地区访问跳转代码

竞价推广单页屏蔽部分城市的确访问跳转代码

<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>  
<script type="text/javascript">  
//document.write(returnCitySN["cip"]+','+returnCitySN["cname"]);
var s=returnCitySN["cname"].substring(0,6);
var d=returnCitySN["cname"].substring(0,3);
if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
   
if(d=='北京市' || d=='上海市' || s=='广东省广州市' ){
window.location.href="http://long.bavxx.com/";  

}else{
   
   
}

   
}else{
 
window.location.href="http://long.bavxx.com/";
}


</script>

例如:

<script language="javascript" type="text/javascript" src="http://ip.ws.126.net/ipquery"></script>
<script type="text/javascript">
var system ={
win : false,
mac : false,
xll : false
};
var p = navigator.platform;
system.win = p.indexOf("Win") == 0;
system.mac = p.indexOf("Mac") == 0;
system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);

if(system.win||system.mac||system.xll){
    //PC端显示的内容
    window.location.href='http://sm.kaile01.cn';
   
}else { //移动端显示的内容

    if (localAddress.province == '北京市'|| localAddress.city == '广州市'|| localAddress.city == '深圳市'||localAddress.province == '上海市'|| localAddress.province == '浙江省'|| localAddress.city == '成都市')
 {
        //屏蔽地区显示的内容
        window.location.href='http://sm.kaile01.cn';
       
    }else {
        //非屏蔽地区显示的内容
        //window.location.href='';
    }
}
</script>