当前位置:网站首页>根据设备信息进行页面跳转至移动端页面或者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");
边栏推荐
猜你喜欢

mysql插入数据创建触发器填充uuid字段值

Deconvolution popular detailed analysis and nn Convtranspose2d important parameter interpretation

高数_第1章空间解析几何与向量代数_向量的数量积

ORM--数据库增删改查操作逻辑

The request object parses the request body and request header parameters

ORM模型--关联字段,抽象模型类

STM32 ADC和DMA

Postman interface test III

Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT

How to cancel automatic saving of changes in sqlyog database
随机推荐
Smart city construction based on GIS 3D visualization technology
STM32中AHB总线_APB2总线_APB1总线这些是什么
request对象对请求体,请求头参数的解析
Some test points about coupon test
柏拉图和他的三个弟子的故事:如何寻找幸福?如何寻找理想伴侣?
Before joining the chain home, I made a competitive product analysis for myself
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
How to cancel automatic saving of changes in sqlyog database
反卷积通俗详细解析与nn.ConvTranspose2d重要参数解释
IPv4 socket address structure
Web3.0 series distributed storage IPFs
Fiddler break point
Postman interface test V
Using keras in tensorflow to build convolutional neural network
Introduction to energy Router: Architecture and functions for energy Internet
Guide de signature du Code Appx
【学习笔记-李宏毅】GAN(生成对抗网络)全系列(一)
Why does the starting service report an error when installing MySQL? (operating system Windows)
Apprentissage avancé des fonctions en es6