对于确定JS内置对象类型,JS提供了typeof运算符,该运算符得到的结果为以下6种:number,boolean,string,function,object,undefined.不过对绝大多数对象而言,typeof都返回"object",无法确定具体的类型.我们使用一种函数Object.prototype.toString.call来判断 <script> var a = 1; console.log("a:"+typeof a); //number
方法一: var isPC = function () { var userAgentInfo = navigator.userAgent.toLowerCase(); var Agents = new Array("android", "iphone", "symbianOS", "windows phone", "ipad", "ipod"); var flag = true; fo