当前位置:网站首页>Jump to the mobile terminal page or PC terminal page according to the device information
Jump to the mobile terminal page or PC terminal page according to the device information
2022-07-07 10:23:00 【weixin_ forty-two million one hundred and seventy-eight thousan】
The code is as follows :
function browserRedict(pcurl, moburl) {
let userAgentInfo = navigator.userAgent.toLowerCase();
let device = /ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/;
if(device.test(userAgentInfo)){
window.location.href = moburl;
} else {
window.location.href = pcurl;
}
};
browserRedict("pc.example.com", "mob.example.com");
边栏推荐
猜你喜欢
P1031 [NOIP2002 提高组] 均分纸牌
The physical meaning of imaginary number J
Es classes and objects, prototypes
求方程ax^2+bx+c=0的根(C语言)
Google colab loads Google drive (Google drive is used in Google colab)
Encrypt and decrypt stored procedures (SQL 2008/sql 2012)
STM32 Basics - memory mapping
Postman interface test VII
SolidWorks工程图中添加中心线和中心符号线的办法
浅谈日志中的返回格式封装格式处理,异常处理
随机推荐
@Transcation的配置,使用,原理注意事项:
[second on] [jeecgboot] modify paging parameters
SQLyog数据库怎么取消自动保存更改
IIC基本知识
Weekly recommended short videos: what are the functions of L2 that we often use in daily life?
table宽度比tbody宽度大4px
ORM -- grouping query, aggregation query, query set queryset object properties
STM32 Basics - memory mapping
When there are pointer variable members in the custom type, the return value and parameters of the assignment operator overload must be reference types
Study summary of postgraduate entrance examination in October
根据设备信息进行页面跳转至移动端页面或者PC端页面
CONDA creates virtual environment offline
[learning notes - Li Hongyi] Gan (generation of confrontation network) full series (I)
Guid primary key
Methods of adding centerlines and centerlines in SolidWorks drawings
Slurm资源管理与作业调度系统安装配置
[email protected]能帮助我们快速拿到日志对象
This article explains the complex relationship between MCU, arm, muc, DSP, FPGA and embedded system
UnityWebRequest基础使用之下载文本、图片、AB包
.NET配置系统