当前位置:网站首页>js to determine whether it is a pc or a mobile terminal (including ipad)
js to determine whether it is a pc or a mobile terminal (including ipad)
2022-08-01 15:02:00 【Five Queens】
vaildatePc = function() {const userAgentInfo = navigator.userAgent;const Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"];let flag = true;for (var v = 0; v < Agents.length; v++) {if (userAgentInfo.indexOf(Agents[v]) > 0) {flag = false;break;}}return flag;}
true means pc, false means mobile
边栏推荐
- 设计专业第一台笔记本 华硕灵耀Pro16 2022 新品首发超值入手
- 【repo】SyntaxError: invalid syntax
- gconf/dconf实战编程(2)利用gconf库读写配置实战以及诸多配套工具演示
- 沃文特生物IPO过会:年营收4.8亿 养老基金是股东
- ffmpeg视频剪辑中报错Could not write header for output file #0 (incorrect codec parameters ?): ……
- MySQL【创建和管理表】
- 有谁知道pg12.5版本的数据库驱动在哪里能找到么?
- 给网站增加离开页面改变网站标题效果
- LeetCode50天刷题计划(Day 10—— 三数之和(20.50-22.40)
- flink-sql 可以单独配置某个算子节点的并行度吗?
猜你喜欢
The role of the final keyword final and basic types, reference types
30分钟成为Contributor|如何多方位参与OpenHarmony开源贡献?
openEuler 社区12位开发者荣获年度开源贡献之星
The soul asks: How does MySQL solve phantom reads?
预定义和自定义
2022年5月20日最全摸鱼游戏导航
hzero-resource秒退
0-1背包问题的一维数组优化解析
MySQL中的存储过程(详细篇)
如何使用 Mashup 技术在 SAP Cloud for Customer 页面嵌入自定义 UI
随机推荐
【LeetCode】37、解数独
Zhaoqi Science and Technology Innovation Event Platform, Entrepreneurship Event Roadshow, Online Live Roadshow
tkinter-TinUI-xml实战(6)问卷
gconf/dconf实战编程(3)利用dconf库读写配置实战以及诸多配套工具演示
LeetCode50天刷题计划(Day 10—— 三数之和(20.50-22.40)
MySQL:索引
Chat technology in live broadcast system (8): Architecture practice of IM message module in vivo live broadcast system
大神们,ODPS用的是MySQL吗?
JSON数据转换总结(VIP典藏版)
MBI5020 LED Driver
测试工程师进阶必读书目
What is a closure?
通胀持续 肯尼亚粮食安全引关注
透过现象看本质,如何针对用户做好需求分析
HTB-Mirai
【论文笔记】MiniSeg: An Extremely Minimum Network for Efficient COVID-19 Segmentation
The soul asks: How does MySQL solve phantom reads?
Performance Optimization - Rendering Optimization Notes
细读《阿里测试之道》
长江欧拉生态创新中心成立,武汉数字经济再添坚实底座