当前位置:网站首页>JS mobile phone and computer open different websites
JS mobile phone and computer open different websites
2022-06-25 19:34:00 【Bin daotianxia】
First , Remember to introduce one JS, Or down there js Don't take effect
Then replace the links inside
Mobile terminal Write this code to 《hader》 Inside the label
<script>
if( navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
){
}else{
window.location.href="../index.html"; // This is the home page link of the computer
}
</script>Computer terminal Write this code to 《hader》 Inside the label
<script type="text/javascript">
function browserRedirect() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if(bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM){
window.location.href = "m/index.html"; // This is the homepage of the mobile website
}
}
browserRedirect();
</script>
边栏推荐
- Detailed explanation of oauth2 - Introduction (I)
- Tiger Dao VC products are officially launched, a powerful supplement to seektiger ecology
- PHP database connection version1.1
- 最新数据挖掘赛事方案梳理!
- Jump jump games auxiliary (manual version) py code implementation
- JVM | runtime data area (heap space)
- Oriental Wealth function (the most complete edition of Childe Yong)
- Vulnhub range - correlation:2
- Connecting PHP to MySQL instances in the lamp environment of alicloud's liunx system
- Guangzhou Sinovel interactive VR panorama brings development to all walks of life
猜你喜欢
![Analysis on planting area, output and import of sugarcane in Guangxi in 2021: the output of sugarcane in Guangxi accounts for 68.56% of the total output of sugarcane in China [figure]](/img/c9/f2a8c3c4ddf28d96d8bfc7bc31a4fe.jpg)
Analysis on planting area, output and import of sugarcane in Guangxi in 2021: the output of sugarcane in Guangxi accounts for 68.56% of the total output of sugarcane in China [figure]

Miner's Diary: why should I go mining on April 5, 2021

Vulnhub range - the planes:venus

为什么生命科学企业都在陆续上云?

Uncover ges super large scale graph computing engine hyg: Graph Segmentation

Elastic high-performance computing on the cloud supports the rapid development of the life science industry, reducing costs and increasing efficiency
![Analysis on development scale and development trend of China's night economy industry in 2021 [figure]](/img/57/d6821fca9a608bf33e78287cf26bae.jpg)
Analysis on development scale and development trend of China's night economy industry in 2021 [figure]

New features of php7

Leetcode-101-symmetric binary tree

Using flex to implement the Holy Grail layout is as simple as that
随机推荐
Can GoogleSEO only do content without external chain? (e6zzseo)
The meanings of /32, /48, /64 in IPv6 addresses
QQ机器人:群成员自我禁言管理【最新beta2版本】
Process of vacuum and vacuum full
Solve the problem that sublime Text3 package control cannot install plug-ins
二、HikariCP獲取連接流程源碼分析二
LeetCode-101-对称二叉树
electron 基础项目搭建 &&主线程和渲染线程的通信
Is it safe to open an account with flush?
Using flex to implement the Holy Grail layout is as simple as that
Guangzhou Sinovel interactive creates VR Exhibition Hall panoramic online virtual exhibition hall
QQ robot official plug-in loading configuration method [beta2 version]
Kotlin Compose 终结toDo项目 点击可以编辑修改todo
Vulnhub range the planes:earth
Randomly generate 100 non repeating numbers between 1 and 150 and put them in the array
Yum command
Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]
MySQL transaction explanation
削足适履 - 谈谈赛道上的坡道改造
Leetcode-101-symmetric binary tree