您的位置:首页 > 移动开发 > Android开发

js判断移动端是Android登录还是iPhone登录

2017-02-21 15:23 411 查看
//js判断是Android登录还是iPhone登录
function getSystem(){
var useragent = navigator.userAgent.toUpperCase();
if(useragent.indexOf('iPod')>-1 || useragent.indexOf('iPhone')>-1 || useragent.indexOf('IPHONE')>-1){
return "iPhone";
}else{
return "Android";
}
}

js判断是Android登录还是iPhone登录

function _login(){
var txtName=$("#txtName").val();
var txtPass=$("#txtPass").val();
if(getSystem()=="Android"){
window.Android.login(txtName,txtPass);
}
$("#LogonForm").submit();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: