var userAgentInfo = navigator.userAgent;if (userAgentInfo.indexOf("Tablet") > 0) { //平板 }else{ //PC }