본문 바로가기

Web/Javascript

redirect for mobile browser

<script type="text/javascript">
if (navigator.userAgent.match(/iPad/) == null && navigator.userAgent.match(/Mobile|Windows CE|Windows Phone|Opera Mini|POLARIS/) != null)
    location.href = "http://" + location.host + "/m" + location.pathname;
</script>

'Web > Javascript' 카테고리의 다른 글

google web font  (0) 2013.09.26
syntaxhighlighter 사용법  (0) 2013.09.26
createRange  (0) 2013.09.26
createElement  (0) 2013.09.26
addTag  (0) 2013.09.26