当前位置:网站首页>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");
边栏推荐
- HDU-2196 树形DP学习笔记
- Postman interface test VII
- 0x0fa23729 (vcruntime140d.dll) (in classes and objects - encapsulation.Exe) exception thrown (resolved)
- 对存储过程进行加密和解密(SQL 2008/SQL 2012)
- 2022.7.3DAY595
- ORM -- grouping query, aggregation query, query set queryset object properties
- 01 use function to approximate cosine function (15 points)
- Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
- Vs code specifies the extension installation location
- php \n 换行无法输出
猜你喜欢

柏拉图和他的三个弟子的故事:如何寻找幸福?如何寻找理想伴侣?

【acwing】789. Range of numbers (binary basis)

SQLyog数据库怎么取消自动保存更改

01 use function to approximate cosine function (15 points)

Serial communication relay Modbus communication host computer debugging software tool project development case

LLVM之父Chris Lattner:為什麼我們要重建AI基礎設施軟件

JMeter loop controller and CSV data file settings are used together

The physical meaning of imaginary number J

电表远程抄表拉合闸操作命令指令

STM32 Basics - memory mapping
随机推荐
【acwing】789. 数的范围(二分基础)
The request object parses the request body and request header parameters
【HigherHRNet】 HigherHRNet 详解之 HigherHRNet的热图回归代码
Study summary of postgraduate entrance examination in November
【acwing】789. Range of numbers (binary basis)
XML configuration file parsing and modeling
Advanced function learning in ES6
P2788 数学1(math1)- 加减算式
Inno Setup 打包及签名指南
[higherhrnet] higherhrnet detailed heat map regression code of higherhrnet
Word自动生成目录的方法
Use the fetch statement to obtain the repetition of the last row of cursor data
ORM model -- creation and query of data records
ORM model -- associated fields, abstract model classes
反射效率为什么低?
C#记录日志方法
Review of the losers in the postgraduate entrance examination
单片机(MCU)最强科普(万字总结,值得收藏)
每周推荐短视频:L2级有哪些我们日常中经常会用到的功能?
Fiddler break point