zoukankan      html  css  js  c++  java
  • 检测设备是PC还是手机客户端

    1.引用 /Files/ggbbeyou/useragents.rar

    2.

    <script type="text/javascript" src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="~/Scripts/useragents.js"></script>
    <script type="text/javascript">
        Browsers = new UserAgents(navigator.userAgent, {
            useFeatures: true,
            detectCamouflage: true
        });
        $(function () {
            $("#txtBrower").val(Browsers);
        });

    </script>

    以下是参数:  '"camouflage": "' + (Browsers.camouflage ? '1' : '0') + '",' +
             '"features": "' + (Browsers.features.join(',')) + '",' +
             '"browserName": "' + (Browsers.browser.name ? Browsers.browser.name : '') + '",' +
             '"browserChannel": "' + (Browsers.browser.channel ? Browsers.browser.channel : '') + '",' +
             '"browserVersion": "' + (Browsers.browser.version ? Browsers.browser.version.toString() : '') + '",' +
             '"browserVersionType": "' + (Browsers.browser.version ? Browsers.browser.version.type : '') + '",' +
             '"browserVersionMajor": "' + (Browsers.browser.version ? Browsers.browser.version.major : '') + '",' +
             '"browserVersionMinor": "' + (Browsers.browser.version ? Browsers.browser.version.minor : '') + '",' +
             '"browserVersionOriginal": "' + (Browsers.browser.version ? Browsers.browser.version.original : '') + '",' +
             '"browserMode": "' + (Browsers.browser.mode ? Browsers.browser.mode : '') + '",' +
             '"engineName": "' + (Browsers.engine.name ? Browsers.engine.name : '') + '",' +
             '"engineVersion": "' + (Browsers.engine.version ? Browsers.engine.version.toString() : '') + '",' +
             '"osName": "' + (Browsers.os.name ? Browsers.os.name : '') + '",' +
             '"osVersion": "' + (Browsers.os.version ? Browsers.os.version.toString() : '') + '",' +
             '"deviceManufacturer": "' + (Browsers.device.manufacturer ? Browsers.device.manufacturer : '') + '",' +
             '"deviceModel": "' + (Browsers.device.model ? Browsers.device.model : '') + '",' +
             '"deviceType": "' + (Browsers.device.type ? Browsers.device.type : '') + '",' +
             '"deviceWidth": "' + (Browsers.device.type != 'desktop' ? screen.width : '') + '",' +
             '"deviceHeight": "' + (Browsers.device.type != 'desktop' ? screen.height : '') + '",' +
    http://html5test.com/
  • 相关阅读:
    招隐-古琴曲-山中鸣琴,万籁声沉沉,何泠泠!
    因循苟且逸豫而无为,可以侥幸一时,而不可以旷日持久。——王安石
    模糊理论在图像处理中的应用
    铁关-中国首都警官合唱团-歌词
    听着总感觉莫名熟悉的音乐汇总
    石鼓歌-韩愈
    唐长安城
    唐长安的信仰——读书笔记
    Eclipse安装java web插件
    Java调用MySql数据库函数
  • 原文地址:https://www.cnblogs.com/ggbbeyou/p/2778432.html
Copyright © 2011-2022 走看看