当前位置:网站首页>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");
边栏推荐
- 对存储过程进行加密和解密(SQL 2008/SQL 2012)
- PDF文档签名指南
- Learning records - high precision addition and multiplication
- Programming features of ISP, IAP, ICP, JTAG and SWD
- [sword finger offer] 42 Stack push in and pop-up sequence
- Kotlin实现微信界面切换(Fragment练习)
- 求方程ax^2+bx+c=0的根(C语言)
- Remote meter reading, switching on and off operation command
- 字符串格式化
- ArcGIS operation: converting DWG data to SHP data
猜你喜欢

STM32 Basics - memory mapping

Use the fetch statement to obtain the repetition of the last row of cursor data

STM32中AHB总线_APB2总线_APB1总线这些是什么

Google colab loads Google drive (Google drive is used in Google colab)

Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software

PDF文档签名指南

Smart city construction based on GIS 3D visualization technology

Methods of adding centerlines and centerlines in SolidWorks drawings
![[learning notes - Li Hongyi] Gan (generation of confrontation network) full series (I)](/img/94/b4df1ce2861a851fcd8de3e08540b0.png)
[learning notes - Li Hongyi] Gan (generation of confrontation network) full series (I)

Word自动生成目录的方法
随机推荐
一文讲解单片机、ARM、MUC、DSP、FPGA、嵌入式错综复杂的关系
Smart city construction based on GIS 3D visualization technology
C logging method
Study summary of postgraduate entrance examination in October
ORM model -- creation and query of data records
单片机(MCU)最强科普(万字总结,值得收藏)
ORM -- logical relation and & or; Sort operation, update record operation, delete record operation
Review of the losers in the postgraduate entrance examination
Inno Setup 打包及签名指南
字符串格式化
【acwing】789. 数的范围(二分基础)
Or in SQL, what scenarios will lead to full table scanning
Study summary of postgraduate entrance examination in September
深入分析ERC-4907协议的主要内容,思考此协议对NFT市场流动性意义!
Embedded background - chip
ArcGIS operation: batch modify attribute table
【华为机试真题详解】高矮个子排队
Differences between MCU and MPU
Postman tutorial - scripting
Postman interface test II