Programing
[WEB]디바이스 체크 checkMobile
애플자라
2021. 10. 22. 08:47
반응형
<script>
function checkMobile(){
var varUA = navigator.userAgent.toLowerCase(); //userAgent 값 얻기
if ( varUA.indexOf('android') > -1) { //안드로이드
// return "android";
return "https://mgws.applejara.com";
} else if ( varUA.indexOf("iphone") > -1||varUA.indexOf("ipad") > -1||varUA.indexOf("ipod") > -1 ) { //IOS
// return "ios";
return "https://mgws.applejara.com";
} else { //아이폰, 안드로이드 외
return "other";
}
}
</script>
반응형