본문 바로가기
html, css, javascript/javascript/jquery

[javascript] 모바일 / PC 접속 구분하기

by 허그미 2020. 3. 9.
반응형
출처: https://88240.tistory.com/393 [shaking blog]
var filter = "win16|win32|win64|mac|macintel"; 
  if ( navigator.platform ) { 
    if ( filter.indexOf( navigator.platform.toLowerCase() ) < 0 ) { 
      //mobile 
      alert('mobile 접속'); 
    } else { 
      //pc 
      alert('pc 접속'); 
  } 
}

반응형

댓글