欢迎访问米卓网络网站,我们专业从事重庆网站建设,重庆网站制作,重庆网站设计,重庆网络推广服务!
空间域名 网站建设 网络推广
低投资高回报
网站不是花钱 是为了赚更多的钱
注重用户口碑
只有客户的满意 才有我们的发展
精湛精英团队
多年开发经验 铸就企业成功之路
主页 > 新闻资讯 > 建站技术 >

手机网站适配跳转代码收集

作者:米卓网络 时间:2017-06-02 15:08:28 浏览: 
1、

<script> window.jQuery || document.write('<scri'+'pt src="/assets/js/jq.js"><\/scr'+'ipt>'); </script><script type="text/javascript" src="/assets/js/index.js"></script><script type="text/javascript">try {
var urlhash = window.location.hash;
if (!urlhash.match("fromapp"))
{
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)))
{
window.location="http://m.cqqq.cn/";
}
}
}
catch(err)
{
}
</script>

2、<script type="text/javascript">
 
function IsPC()  
{  
           var userAgentInfo = navigator.userAgent;  
           var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");  
           var flag = true;  
           for (var v = 0; v < Agents.length; v++) {  
               if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }  
           }  
           return flag;  
}   
 
if(!IsPC())   
{
window.location.href="http://m.polyde.com";
 
}       
</script>

3、<script>
            var is_mobi = navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
            if (is_mobi) {
                window.location.href = "/m/index.php";
            }
        </script>

4、var mobi = (/Android|iPhone|iPad|iPod|BlackBerry/i).test(navigator.userAgent || navigator.vendor || window.opera);
if (mobi) {
    window.location.href = 'http://isto.net.cn/Mobile/';
}


5、<script type="text/javascript">      
function browserRedirect() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if(bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM){
window.location.href = "http://4g.91-yoga.com/";
}
}
browserRedirect();
</script>

6、
 <script type="text/javascript">if (/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
        try {
          if (/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
            window.location.href = "http://m.goumin.com/ ";
          } else if (/iPad/i.test(navigator.userAgent)) {} else {
            window.location.href = "http://m.goumin.com/ "
          }
        } catch(e) {}
      }</script>