当前位置:网站首页>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");
边栏推荐
猜你喜欢
ORM model -- creation and query of data records
求方程ax^2+bx+c=0的根(C语言)
P1031 [NOIP2002 提高组] 均分纸牌
ArcGIS operation: converting DWG data to SHP data
Fiddler break point
P2788 数学1(math1)- 加减算式
ES6中的原型对象
High number_ Chapter 1 space analytic geometry and vector algebra_ Quantity product of vectors
Several schemes of building hardware communication technology of Internet of things
[ORM framework]
随机推荐
The request object parses the request body and request header parameters
[second on] [jeecgboot] modify paging parameters
CONDA creates virtual environment offline
串口通讯继电器-modbus通信上位机调试软件工具项目开发案例
Methods of adding centerlines and centerlines in SolidWorks drawings
High number_ Chapter 1 space analytic geometry and vector algebra_ Quantity product of vectors
LLVM之父Chris Lattner:為什麼我們要重建AI基礎設施軟件
Interface test
ISP、IAP、ICP、JTAG、SWD的编程特点
Review of the losers in the postgraduate entrance examination
fiddler-AutoResponder
2022.7.3DAY595
Postman interface test II
Guid primary key
Easyexcel read write simple to use
The variables or functions declared in the header file cannot be recognized after importing other people's projects and adding the header file
Some properties of leetcode139 Yang Hui triangle
学习记录——高精度加法和乘法
MCU与MPU的区别
Encrypt and decrypt stored procedures (SQL 2008/sql 2012)