Created
December 16, 2017 11:45
-
-
Save joshle/d079f1766fa1cd2adc778d3afd63ac61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function IsPC() { | |
| var userAgentInfo = navigator.userAgent; | |
| var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", | |
| "iPod"]; //常用的手机系统版本 | |
| var flag = true; //建立标志 | |
| for (var v = 0; v < Agents.length; v++) { | |
| if (userAgentInfo.indexOf(Agents[v]) > 0) { | |
| flag = false; //如果是手机版本返回false | |
| break; | |
| } | |
| } | |
| return flag; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment