Js Determine the mobile operating system (ios or Android) :

$(function () {
    var u = navigator.userAgent, app = navigator.appVersion;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > 1; //g var isIOS = !! u.match(/\(i[^;] +; ( U;) ? CPU.+Mac OS X/); / / ios terminalif(isAndroid) {// this isAndroid OS}if(isIOS) {         // This is ios operating system}});Copy the code

Js to determine whether it is computer terminal:

function IsPC() {
    var userAgentInfo = navigator.userAgent;
    var Agents = ["Android"."iPhone"."SymbianOS"."Windows Phone"."iPad"."iPod"];
    var flag = true;
    for (var v = 0; v < Agents.length; v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
            flag = false;
            break; }}return flag;
}

Copy the code