Now because of the powerful mobile phone, the use of mobile internet users more and more, then you need to determine the user is the client landing site, if you use a computer version of the Web page, if the use of mobile phone version of the Web page, the following is a can determine whether the phone or computer code:
functioncheck()
{ varuserAgentInfo=navigator.userAgent; varAgents =newArray("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"); varflag=true; for(var v=0;v<Agents.length;v++) { if(userAgentInfo.indexOf(Agents[v])>0) { flag=false; break; } } returnflag; }If the flag return value is True then is the computer client, if it is false, then the use of mobile client, the code is relatively simple here is not much introduction, directly apply on it can be reproduced from http://www.51texiao.cn/ Javascriptjiaocheng/2015/0519/1868.html
How to tell whether it is a mobile phone or a computer visit website: