if (!navigator.userAgent.match(/mobile/i)) { alert("本系统仅支持移动设备访问!"); return false;}else{ //ok,do something here...}//该片段来自于http://www.codesnippet.cn/detail/190720134690.html
来源: http://www.codesnippet.cn/detail/190720134690.html