当前位置:网站首页>根据设备信息进行页面跳转至移动端页面或者PC端页面
根据设备信息进行页面跳转至移动端页面或者PC端页面
2022-07-07 08:10:00 【weixin_42178670】
代码如下:
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 tutorial - scripting
- Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
- “十二星座女神降临”全新活动推出
- ES类和对象、原型
- ORM -- query type, association query
- Programming features of ISP, IAP, ICP, JTAG and SWD
- Arcgis操作: 批量修改属性表
- 对存储过程进行加密和解密(SQL 2008/SQL 2012)
- Why is the reflection efficiency low?
- Web3.0 series distributed storage IPFs
猜你喜欢
Remote meter reading, switching on and off operation command
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
嵌入式背景知识-芯片
ISP、IAP、ICP、JTAG、SWD的编程特点
Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
每周推荐短视频:L2级有哪些我们日常中经常会用到的功能?
STM32 ADC和DMA
ORM -- logical relation and & or; Sort operation, update record operation, delete record operation
串口通讯继电器-modbus通信上位机调试软件工具项目开发案例
The physical meaning of imaginary number J
随机推荐
ArcGIS operation: converting DWG data to SHP data
Official media attention! The list of top 100 domestic digital collection platforms was released, and the industry accelerated the healthy development of compliance
Appx代码签名指南
China's first electronic audio category "Yamano electronic audio" digital collection is on sale!
Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
C#记录日志方法
The new activity of "the arrival of twelve constellations and goddesses" was launched
ISP、IAP、ICP、JTAG、SWD的编程特点
学习记录——高精度加法和乘法
XML配置文件解析与建模
Memory ==c language 1
ORM model -- creation and query of data records
Postman interface test IV
Parameter sniffing (1/2)
Postman interface test I
Before joining the chain home, I made a competitive product analysis for myself
This article explains the complex relationship between MCU, arm, muc, DSP, FPGA and embedded system
ES6中的函数进阶学习
一文讲解单片机、ARM、MUC、DSP、FPGA、嵌入式错综复杂的关系
喜马拉雅网页版每次暂停后弹窗推荐下载客户端解决办法