设备监测

作者: VictoriaZsj | 来源:发表于2019-03-26 11:33 被阅读0次

//设备检测

function detectmob() {

    if( navigator.userAgent.match(/Android/i)

    || navigator.userAgent.match(/webOS/i)

    || navigator.userAgent.match(/iPhone/i)

    || navigator.userAgent.match(/iPad/i)

    || navigator.userAgent.match(/iPod/i)

    || navigator.userAgent.match(/BlackBerry/i)

    || navigator.userAgent.match(/Windows Phone/i)

    ){

    return true;

    }

    else {

    return false;

    }

}

alert(detectmob());

相关文章

网友评论

    本文标题:设备监测

    本文链接:https://www.haomeiwen.com/subject/hatayftx.html