Programming
No. | 673 |
Name. | swindler |
Subject. | 모바일 페이지 분기용 스크립트 |
Main Cate. | Javascript |
Sub Cate. | |
Date. | 2010-03-08 10:58 |
Hit. | 5067 (211.36.27.8) |
File. | |
<script language="JavaScript"> //모바일 페이지로 이동. 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) document.location = "http://"+ location.host +"/m" + location.pathname; </script> jsp 나 java 에서는 String bVer = request.getHeader("User-Agent"); 뭐 저런걸로 'iphone','ipod','android','blackberry','windows ce', 'nokia','webos','opera mini','sonyericsson','opera mobi','iemobile' 이 값들이 있나 찾으면 됩니다. [바로가기 링크] : http://coolx.net/cboard/develop/673 |
|
|
|
[Modify] [Delete] | [Reply] [List] |