当前位置:网站首页>根据设备信息进行页面跳转至移动端页面或者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");
边栏推荐
- Leetcode exercise - 113 Path sum II
- Postman interface test VII
- Appx代碼簽名指南
- STM32 ADC和DMA
- Factorial implementation of large integer classes
- 网上可以开炒股账户吗安全吗
- Vs code specifies the extension installation location
- Embedded background - chip
- Appx code signing Guide
- Programming features of ISP, IAP, ICP, JTAG and SWD
猜你喜欢
request对象对请求体,请求头参数的解析
Wallys/IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL CONCURRENT
【剑指Offer】42. 栈的压入、弹出序列
AHB bus in stm32_ Apb2 bus_ Apb1 bus what are these
ORM--分组查询,聚合查询,查询集QuerySet对象特性
The Hal library is configured with a general timer Tim to trigger ADC sampling, and then DMA is moved to the memory space.
STM32 ADC and DMA
Google colab loads Google drive (Google drive is used in Google colab)
Memory ==c language 1
The landing practice of ByteDance kitex in SEMA e-commerce scene
随机推荐
Postman interface test II
【学习笔记-李宏毅】GAN(生成对抗网络)全系列(一)
In addition to the objective reasons for overtime, what else is worth thinking about?
C logging method
Postman interface test VII
Methods of adding centerlines and centerlines in SolidWorks drawings
Embedded background - chip
嵌入式背景知识-芯片
Can I open a stock trading account online? Is it safe
2022.7.4DAY596
【acwing】789. 数的范围(二分基础)
ES6中的函数进阶学习
The method of word automatically generating directory
STM32中AHB总线_APB2总线_APB1总线这些是什么
Vs code specifies the extension installation location
Interface test
Introduction to uboot
Learning records - high precision addition and multiplication
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
ORM模型--数据记录的创建操作,查询操作