V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jszx1995
V2EX  ›  问与答

关于 js 的 useragent 判断代码修改?

  •  
  •   jszx1995 · May 7, 2015 · 2082 views
    This topic created in 4008 days ago, the information mentioned may be changed or developed.

    比如一台手机的浏览器ua是 Android 4.1.1; en-us; Nexus One Build/FRF91。

    另一台是 Android 4.1.1; en-us; Build/FRF90;这一台比上一台少了Nexus One的字符。

    如何修改到这段代码同时判断是否是安卓Android 4.1.1,然后又是Nexus One。应如何修改

    if(/Android 4.1.1/i.test(navigator.userAgent)){document.writeln('Android 4.1.1 Nexus One');}

    各位大侠帮帮忙

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5338 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 03:51 · PVG 11:51 · LAX 20:51 · JFK 23:51
    ♥ Do have faith in what you're doing.