如何针对手机浏览器和桌面浏览器执行不同的JS语句

来源:互联网 发布:淘宝上卖高仿名牌包包 编辑:程序博客网 时间:2024/05/01 10:39
var ua = window.navigator.userAgent.toLowerCase();    if (ua.indexOf('android') != -1) {        location.replace('android.html');    } else if (ua.indexOf('iphone') != -1) {        location.replace('iphone.html');    }else{        location.replace('pc.html');    }


0 0