Javascript
[Javascript] - 자바스크립트 모바일 기기 구분
Vivara
2014. 5. 26. 19:54
반응형
var uAgent = navigator.userAgent.toLowerCase();
var mobilePhones = new Array('iphone','ipod','android','blackberry','windows ce',
'nokia','webos','opera mini','sonyericsson','opera mobi','iemobile');
for(var i=0;i<mobilePhones.length;i++) {
if(uAgent.indexOf(mobilePhones[i]) != -1) {
console.log( mobilePhones[i] );
}
}
반응형