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

嵌入式背景知识-芯片

Postman interface test VII

对存储过程进行加密和解密(SQL 2008/SQL 2012)

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

【剑指Offer】42. 栈的压入、弹出序列

每周推荐短视频:L2级有哪些我们日常中经常会用到的功能?

Review of the losers in the postgraduate entrance examination

ORM -- grouping query, aggregation query, query set queryset object properties

The variables or functions declared in the header file cannot be recognized after importing other people's projects and adding the header file

Postman interface test II
随机推荐
Or in SQL, what scenarios will lead to full table scanning
AHB bus in stm32_ Apb2 bus_ Apb1 bus what are these
When there are pointer variable members in the custom type, the return value and parameters of the assignment operator overload must be reference types
Postman interface test II
0x0fa23729 (vcruntime140d.dll) (in classes and objects - encapsulation.Exe) exception thrown (resolved)
STM32中AHB总线_APB2总线_APB1总线这些是什么
fiddler-AutoResponder
1321:【例6.3】删数问题(Noip1994)
table宽度比tbody宽度大4px
ES6中的原型对象
Study summary of postgraduate entrance examination in November
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
Inno setup packaging and signing Guide
学习记录——高精度加法和乘法
Interface test
每周推荐短视频:L2级有哪些我们日常中经常会用到的功能?
P2788 数学1(math1)- 加减算式
Postman interface test VI
Appx代碼簽名指南
Some properties of leetcode139 Yang Hui triangle