当前位置:网站首页>根据设备信息进行页面跳转至移动端页面或者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");
边栏推荐
- [second on] [jeecgboot] modify paging parameters
- STM32 Basics - memory mapping
- Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
- AHB bus in stm32_ Apb2 bus_ Apb1 bus what are these
- fiddler-AutoResponder
- Parameter sniffing (2/2)
- ES6中的函数进阶学习
- Deconvolution popular detailed analysis and nn Convtranspose2d important parameter interpretation
- The new activity of "the arrival of twelve constellations and goddesses" was launched
- The physical meaning of imaginary number J
猜你喜欢

fiddler-AutoResponder

PDF文档签名指南

Encrypt and decrypt stored procedures (SQL 2008/sql 2012)

The Himalaya web version will pop up after each pause. It is recommended to download the client solution

Weekly recommended short videos: what are the functions of L2 that we often use in daily life?

Use of JSON extractor originals in JMeter

【学习笔记-李宏毅】GAN(生成对抗网络)全系列(一)

ORM--分组查询,聚合查询,查询集QuerySet对象特性

ES6中的原型对象

Es classes and objects, prototypes
随机推荐
Inno Setup 打包及签名指南
Embedded background - chip
AHB bus in stm32_ Apb2 bus_ Apb1 bus what are these
大整数类实现阶乘
ES类和对象、原型
conda离线创建虚拟环境
Easyexcel read write simple to use
官媒关注!国内数字藏品平台百强榜发布,行业加速合规健康发展
Finally, there is no need to change a line of code! Shardingsphere native driver comes out
ES6中的原型对象
Weekly recommended short videos: what are the functions of L2 that we often use in daily life?
HAL库配置通用定时器TIM触发ADC采样,然后DMA搬运到内存空间。
Introduction to energy Router: Architecture and functions for energy Internet
EasyExcel读取写入简单使用
嵌入式工程师如何提高工作效率
request对象对请求体,请求头参数的解析
Bit operation ==c language 2
LeetCode 练习——113. 路径总和 II
Guid primary key
ORM--数据库增删改查操作逻辑