当前位置:网站首页>JS determines whether the mobile terminal or the PC terminal
JS determines whether the mobile terminal or the PC terminal
2022-07-02 05:51:00 【Front end of brick moving】
js Judge whether the mobile terminal is pc End
function isMobile() {
let userAgentInfo = navigator.userAgent;
let Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
let getArr = Agents.filter(i => userAgentInfo.includes(i));
return getArr.length ? true : false;
}
Judge whether it is pc End
- true: Mobile
- false: pc End
边栏推荐
- mysql事务和隔离级别
- PHP extensions
- PHP gets CPU usage, hard disk usage, and memory usage
- 【技术随记-08】
- PHP array to XML
- 简单封装 js并应用
- PHP inner class name is the same as the inner class method name
- RGB infinite cube (advanced version)
- Lantern Festival gift - plant vs zombie game (realized by Matlab)
- Zzuli:1066 character classification statistics
猜你喜欢

Importation de studio visuel

Vite打包后的dist不能直接在浏览器打开吗

15 C language advanced dynamic memory management

Matplotlib double Y axis + adjust legend position

正则表达式总结

Can't the dist packaged by vite be opened directly in the browser

brew install * 失败,解决方法

PHP 开发与测试 Webservice(SOAP)-Win

“简单”的无限魔方

2022-2-15 learning xiangniuke project - Section 8 check login status
随机推荐
如何写出好代码 — 防御式编程指南
brew install * 失败,解决方法
5g market trend in 2020
Get the details of the next largest number
DRM display framework as I understand it
Balsamiq wireframes free installation
"Simple" infinite magic cube
[PHP是否安装了 SOAP 扩]对于php实现soap代理的一个常见问题:Class ‘SoapClient‘ not found in PHP的处理方法
Taskbar explicit / implicit toggle function
php按照指定字符,获取字符串中的部分值,并重组剩余字符串为新的数组
GRBL 软件:简单解释的基础知识
PHP inner class name is the same as the inner class method name
RGB 无限立方体(高级版)
Common protocols and download paths of NR
Technologists talk about open source: This is not just using love to generate electricity
460. LFU cache bidirectional linked list
【LeetCode】Day92-盛最多水的容器
软件测试答疑篇
Zzuli:1065 count the number of numeric characters
js判断移动端还是pc端