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)交流
  • 相关阅读:
    ios存储 plist 偏好设置 自定义对象存储
    Spring中Bean的生命中期与InitializingBean和DisposableBean接口
    Spring中BeanPostProcessor
    cxf
    ios快捷键
    UIPickerView
    ios通知-kvo
    7.python 装饰器
    5.python内置函数
    4.python 深拷贝 浅拷贝 函数 匿名函数lambda
  • 原文地址:https://www.cnblogs.com/linyusong/p/6420067.html
Copyright © 2011-2022 走看看