原声JS判断程序运行平台Pc OR Mobile
来源:互联网 发布:ubuntu wget安装 编辑:程序博客网 时间:2024/05/22 11:10
var userAgent = navigator.userAgent.toLowerCase();if(!userAgent.match(".*(ip(hone|od)).*") && !userAgent.match(".*(android.+mobile|bada\\/|blackberry|iemobile|kindle|wap|windows (ce|phone)).*")) { console.log("运行在电脑平台");}else { console.log("运行在手机平台");}
标记一下,代码小生。
阅读全文
0 0
- 《Springboot极简教程》SpringBoot plus Mongodb开发企业级restfeel接口测试平台
- wait-notify 实现多线程交叉备份
- Myeclipse2015把web项目添加至tomcat中,添加列表中却没有想要添加的项目
- 《Springboot极简教程》问题解决:Springboot启动报错 Whitelabel Error Page: This application has no explicit mapping for
- 《Springboot极简教程》问题解决:javax.servlet.ServletException: Circular view path [login]: would dispatch back to the current handler URL
- 原声JS判断程序运行平台Pc OR Mobile
- 《Springboot极简教程》继承WebMvcConfigurerAdapter: 一行代码写Controller
- LeetCode 105. Construct Binary Tree from Preorder and Inorder Traversal
- 搭建Maven(搭建+问题笔记)
- 《Springboot极简教程》问题解决:Idea解决Gradle库依赖冲突问题:Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting
- 传递WinMain的参数给main
- 《Springboot极简教程》问题解决:org.apache.catalina.LifecycleException: A child container failed during start
- 邮件发送和接收原理
- 【tyvj1098】任务安排(dp)