스마트폰으로 접속시 특정 사이트로 이동 소스 Javascript
프로그래밍/HTML & JavaScript2015. 1. 27. 11:25
반응형
아이폰, 아이팟, 윈도우모바일, 심비안, 블랙베리, 안드로이드로 접속시 웹하드로 바로 접속되게 만들어주는 소스.
아닐 경우 다른 사이트로 이동.
Javascript, HTML에서 바로 사용이 가능함.
<script type="text/javascript">
if((navigator.userAgent.match(/iPhone/i))
||
(navigator.userAgent.match(/iPod/i))
||
(navigator.userAgent.match(/Windows CE/i))
||
(navigator.userAgent.match(/Symbian/i))
||
(navigator.userAgent.match(/BlackBerry/i))
||
(navigator.userAgent.match(/Android/i)) )
{
parent.window.location.href='http://heeseop.lgnas.com:8000';
} else { parent.window.location.href='http://heeseop.lgnas.com/gb/bbs/board.php?bo_table=Guestbook'; }
</script>
if((navigator.userAgent.match(/iPhone/i))
||
(navigator.userAgent.match(/iPod/i))
||
(navigator.userAgent.match(/Windows CE/i))
||
(navigator.userAgent.match(/Symbian/i))
||
(navigator.userAgent.match(/BlackBerry/i))
||
(navigator.userAgent.match(/Android/i)) )
{
parent.window.location.href='http://heeseop.lgnas.com:8000';
} else { parent.window.location.href='http://heeseop.lgnas.com/gb/bbs/board.php?bo_table=Guestbook'; }
</script>
[출처] HEESEOP'S BLOG (http://wima57.tistory.com/287)
반응형
'프로그래밍 > HTML & JavaScript' 카테고리의 다른 글
자바스크립트 펼치기 접기 소스 2 (0) | 2015.01.27 |
---|---|
자바스크립트 펼치기 접기 소스 (0) | 2015.01.27 |
[HTML] 스마트폰에서 홈페이지 잘 보이게 하는 방법 (0) | 2015.01.27 |
한개의 체크박스만 선택 가능하게 설정 (0) | 2015.01.27 |
체크박스 전체선택 해제 & 체크박스 선택 삭제 (0) | 2015.01.27 |
댓글()