in Codex

JS获取终端类型

var g_sUA = navigator.userAgent.toLowerCase();
var android = g_sUA.match(/(android)\s+([\d.]+)/);
var ios = g_sUA.match(/(ipad|iphone|ipod).*os\s([\d_]+)/);
var isAndroid = !!android;
var isIos = !!ios;

Write a Comment

Comment

  • Related Content by Tag