모바일 접속 에이전트 처리

script 2013. 4. 27. 13:10
<script type="text/javascript">
// goto mobile page
//http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones
if (navigator.userAgent.match(/iPad/) == null && navigator.userAgent.match(/iPhone|Mobile|UP.Browser|Android|BlackBerry|Windows CE|Nokia|webOS|Opera Mini|SonyEricsson|opera mobi|Windows Phone|IEMobile|POLARIS/) != null)
    location.href = "http://" + location.host + "/m.htm" + location.pathname;
</script>
Trackbacks 0 : Comments 0

Write a comment