Detecting a mobile webbrowser in Javascript

July 13, 2024, 10:18 p.m.

window.onload = function(){
                if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
                    // 모바일인 경우
                    alert(navigator.userAgent);
                } else {
                    alert("Please use mobile phone to use Fatscan.");
                }
            }

Reference


Comments


Related Posts