zoukankan      html  css  js  c++  java
  • 手机登录验证

    //验证是不是手机在登录操作

    function is_mobile() { 
    var regex_match = /(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i; 
    var u = navigator.userAgent; 
    if (null == u) { 
    return true; 

    var result = regex_match.exec(u); 
    if (null == result) { 
    return false 
    } else { 
    return true 

    }

    是手机操作返回true 不是返回false

  • 相关阅读:
    [SCOI2008]奖励关
    [HNOI2015]落忆枫音
    [HAOI2012]高速公路
    [HNOI2012]集合选数
    A. 【UNR #2】积劳成疾
    整体二分
    [HNOI2015]亚瑟王
    [SDOI2010]星际竞速
    [SDOI2010]地精部落
    [SDOI2014]数数
  • 原文地址:https://www.cnblogs.com/niuxi/p/6024558.html
Copyright © 2011-2022 走看看