[정보] 접속 환경(PC or Mobile)을 구분해주는 자바스크립트 함수
This post was written on February 22, 2023
PC 환경에서 접속한 것인지 모바일 환경에서 접속한 것인지 알아내는 자바스크립트 함수이다. 많이 사용하는 함수이다.
- chatGPT가 만들어 준 함수이다.
function detectDeviceType() { if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { return "mobile"; } else { return "pc"; } }
HS LOG
List of ETC
Copyright © HS LOG
No Comments
Published on February 22, 2023
Thank you for visiting. If you leave a comment, I will not forget.
HS LOG
List of ETC
The number of visitors for this post is 67 (measured by Jetpack).