Client Standard/JavaScript & jQuery
[Js] 모바일, 웹 브라우저 체크
denodo
2014. 8. 25. 10:02
navigator.userAgent
브라우저 userAgent 값들
iPhone, iPod, BlackBerry, Android, Windows CE, LG, MOT, SAMSUNG, SonyEricsson
출처는 바로 이곳, Wikipedia
<script type="text/javascript">
var mobileKeyWords = new Array('iPhone', 'iPod', 'BlackBerry', 'Android', 'Windows CE', 'LG', 'MOT', 'SAMSUNG', 'SonyEricsson');
for (var word in mobileKeyWords){
if (navigator.userAgent.match(mobileKeyWords[word]) != null){
location.href = "보내고 싶은 모바일 경로";
break;
}
var mobileKeyWords = new Array('iPhone', 'iPod', 'BlackBerry', 'Android', 'Windows CE', 'LG', 'MOT', 'SAMSUNG', 'SonyEricsson');
for (var word in mobileKeyWords){
if (navigator.userAgent.match(mobileKeyWords[word]) != null){
location.href = "보내고 싶은 모바일 경로";
break;
}
}
</script>
</script>