当前位置:网站首页>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");
边栏推荐
猜你喜欢

Prototype object in ES6

Adb 实用命令(网络包、日志、调优相关)

串口通讯继电器-modbus通信上位机调试软件工具项目开发案例

P1223 排队接水/1319:【例6.1】排队接水

【acwing】786. 第k个数

柏拉图和他的三个弟子的故事:如何寻找幸福?如何寻找理想伴侣?

Talking about the return format in the log, encapsulation format handling, exception handling
![[ORM framework]](/img/72/13eef38fc14d85978f828584e689a0.png)
[ORM framework]

JMeter installation

ORM -- logical relation and & or; Sort operation, update record operation, delete record operation
随机推荐
柏拉图和他的三个弟子的故事:如何寻找幸福?如何寻找理想伴侣?
A small problem of bit field and symbol expansion
Postman interface test IV
Several schemes of building hardware communication technology of Internet of things
[email protected]能帮助我们快速拿到日志对象
C#记录日志方法
对存储过程进行加密和解密(SQL 2008/SQL 2012)
UnityWebRequest基础使用之下载文本、图片、AB包
PDF文档签名指南
ArcGIS operation: converting DWG data to SHP data
Deconvolution popular detailed analysis and nn Convtranspose2d important parameter interpretation
When there are pointer variable members in the custom type, the return value and parameters of the assignment operator overload must be reference types
Download Text, pictures and ab packages used by unitywebrequest Foundation
高数_第1章空间解析几何与向量代数_向量的数量积
Study summary of postgraduate entrance examination in July
Inno setup packaging and signing Guide
EasyExcel读取写入简单使用
Guid primary key
Leetcode exercise - 113 Path sum II
串口通讯继电器-modbus通信上位机调试软件工具项目开发案例