프로그래밍/JavaScipt

javascript 모바일/웹 분기화 처리 소스

p-a-r-k 2014. 11. 11. 17:36
반응형
var UserAgent = navigator.userAgent;
	
if(UserAgent.match(/iPhone|iPod|iPad|iPad2|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
	top.location.href = "모바일URL";
}else{
	top.location.href = "웹URL";
}
반응형