2018년 7월 11일 수요일
JavaScript - Detect mobile or browsers
http://detectmobilebrowsers.com/
or
-- JavaScript
var filter = "win16|win32|win64|mac|macintel";
if ( navigator.platform ) {
if ( filter.indexOf( navigator.platform.toLowerCase() ) < 0 ) {
//mobile alert('mobile 접속');
}
else {
//pc alert('pc 접속');
}
}
or
// 모바일 에이전트 구분
var isMobile = {
Android: function () {
return navigator.userAgent.match(/Android/i) == null ? false : true;
},
BlackBerry: function () {
return navigator.userAgent.match(/BlackBerry/i) == null ? false : true;
},
IOS: function () {
return navigator.userAgent.match(/iPhone|iPad|iPod/i) == null ? false : true;
},
Opera: function () {
return navigator.userAgent.match(/Opera Mini/i) == null ? false : true;
},
Windows: function () {
return navigator.userAgent.match(/IEMobile/i) == null ? false : true;
},
any: function () {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.IOS() || isMobile.Opera() || isMobile.Windows());
}
};
if(isMobile.any()){
if(isMobile.Android()){
}else if(isMobile.IOS()){
}else if(isMobile.BlackBerry()){
}else if(isMobile.Opera()){
}else if(isMobile.Windows()){
}
}
피드 구독하기:
댓글 (Atom)
javascript - SQL 예약어 제거
<script language="javascript"> //특수문자, 특정문자열(sql예약어) 제거 function checkSearchedWord(obj){ obj.value = obj.value+&quo...
-
C# - 크로스 스레드 (Control.Invoke) 매 1초 마다 현재 시각을 표시하는 간단한 시계를 만든다고 합시다. 2009-05-07 오전 10:44:28 보통은 System.Timers.Timer 나 Sys...
-
JsonUtility 유니티 5.3 이상부터 JsonUtility를 지원한다. 외부 JSON 라이브러리가 필요 없다. < JsonUtility 멤버 함수 > FromJson : JSON을 오브젝트로 변환한다. 오브젝트를 생성...
댓글 없음:
댓글 쓰기