zoukankan      html  css  js  c++  java
  • PC域名跳转手机域名简单代码

    <script src="http://siteapp.baidu.com/static/webappservice/uaredirect.js" type="text/javascript"></script>
    <script type="text/javascript">uaredirect("http://m.test.cn/");</script>

     由于http://siteapp.baidu.com/ 平台访问不了,所以不建议用这个

    //移动设备访问跳转
    var domain = document.domain;
    
    if(domain == "www.123.com"  || domain == "123.com"  ){
        (function(){var ua=navigator.userAgent.toLowerCase();var bIsIpad=ua.match(/ipad/i)=="ipad";var bIsIphoneOs=ua.match(/iphone os/i)=="iphone os";var bIsAndroid=ua.match(/android/i)=="android";var bIsWM=ua.match(/windows mobile/i)=="windows mobile";if(bIsIphoneOs||bIsAndroid||bIsWM){window.location.href = "http://m.456.com/"}})();
    }else{
        
        (function(){var ua=navigator.userAgent.toLowerCase();var bIsIpad=ua.match(/ipad/i)=="ipad";var bIsIphoneOs=ua.match(/iphone os/i)=="iphone os";var bIsAndroid=ua.match(/android/i)=="android";var bIsWM=ua.match(/windows mobile/i)=="windows mobile";if(bIsIphoneOs||bIsAndroid||bIsWM){window.location.href = "http://m.789.cn/"}})();
    转载请注明出处: 欢迎留言或qq(1090413588)交流
  • 相关阅读:
    Windows多线程编程入门
    多字节字符与宽字符
    Linux静态库与动态库详解
    Linux下清理内存和Cache方法
    数据库设计范式
    mybatis面试问题
    Gson使用
    Linux 定时任务crontab使用
    Java-GC机制
    java内存模型
  • 原文地址:https://www.cnblogs.com/linyusong/p/6420067.html
Copyright © 2011-2022 走看看