当前位置:网站首页>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");
边栏推荐
- 基于gis三维可视化技术的智慧城市建设
- C logging method
- Fiddler break point
- Study summary of postgraduate entrance examination in July
- Remote meter reading, switching on and off operation command
- 【acwing】786. Number k
- 【acwing】789. 数的范围(二分基础)
- Fiddler simulates the interface test
- P1031 [NOIP2002 提高组] 均分纸牌
- The request object parses the request body and request header parameters
猜你喜欢
LLVM之父Chris Lattner:為什麼我們要重建AI基礎設施軟件
一文讲解单片机、ARM、MUC、DSP、FPGA、嵌入式错综复杂的关系
Programming features of ISP, IAP, ICP, JTAG and SWD
ArcGIS operation: batch modify attribute table
Methods of adding centerlines and centerlines in SolidWorks drawings
ORM -- grouping query, aggregation query, query set queryset object properties
ISP、IAP、ICP、JTAG、SWD的编程特点
ORM model -- creation and query of data records
串口通讯继电器-modbus通信上位机调试软件工具项目开发案例
Postman interface test V
随机推荐
Why is the reflection efficiency low?
Guid primary key
ISP、IAP、ICP、JTAG、SWD的编程特点
Some properties of leetcode139 Yang Hui triangle
【二开】【JeecgBoot】修改分页参数
Programming features of ISP, IAP, ICP, JTAG and SWD
Some test points about coupon test
Deconvolution popular detailed analysis and nn Convtranspose2d important parameter interpretation
Guide de signature du Code Appx
STM32中AHB总线_APB2总线_APB1总线这些是什么
table宽度比tbody宽度大4px
UnityWebRequest基础使用之下载文本、图片、AB包
柏拉图和他的三个弟子的故事:如何寻找幸福?如何寻找理想伴侣?
学习记录——高精度加法和乘法
JMeter loop controller and CSV data file settings are used together
P1031 [NOIP2002 提高组] 均分纸牌
Vs code specifies the extension installation location
Some thoughts on the testing work in the process of R & D
对存储过程进行加密和解密(SQL 2008/SQL 2012)
Postman interface test II