sniff a mobile browser

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;
            }
        }

  

posted @ 2014-05-19 16:45  skynetfy  阅读(204)  评论(0编辑  收藏  举报