首页 > 代码库 > sniff a mobile browser

sniff a mobile browser

?
1
2
3
4
5
6
7
8
9
10
function isMobile() {   //sniff a mobile browser
            if (navigator.userAgent.match(/Android/i) ||
                navigator.userAgent.match(/webOS/i) ||
                navigator.userAgent.match(/iPad/i) ||
                navigator.userAgent.match(/iPhone/i) ||
                navigator.userAgent.match(/iPod/i)
                ) {
                return true;
            }
        }