当前位置:网站首页>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>
边栏推荐
- Read multiple associations from a field using delimiters in laravel
- System optimization method
- English name of each stage of software version
- 1、 Hikaricp source code analysis of connection acquisition process I
- Analysis on development scale and development trend of China's night economy industry in 2021 [figure]
- Print 1 cute every 100 milliseconds ~ with a running lantern effect
- Guangzhou Sinovel interactive VR panorama brings development to all walks of life
- ActiveMQ--CVE-2016-3088
- How to quickly close port 8080
- Detailed explanation of oauth2 - Introduction (I)
猜你喜欢

Trend ea- fixed stop loss and profit per order

Sorting out the latest data mining competition scheme!

Record Baidu search optimization thinking analysis

ActiveMQ--CVE-2016-3088
![QQ robot epidemic situation query / epidemic situation concern [latest beta2 version]](/img/25/298dc7b79dddd05914d5f3ba070555.png)
QQ robot epidemic situation query / epidemic situation concern [latest beta2 version]

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

Mail monitoring cloud script execution progress

Elastic high-performance computing on the cloud supports the rapid development of the life science industry, reducing costs and increasing efficiency

Guangzhou Sinovel interactive VR panorama brings development to all walks of life

【历史上的今天】6 月 25 日:笔记本之父诞生;Windows 98 发布;通用产品代码首次商用
随机推荐
请问通达信开户安全吗?
Overview and trend analysis of China's CT examination equipment industry in 2021 [figure]
2、 Hikaricp source code analysis of connection acquisition process II
On Oracle full stack virtual machine -- graalvm
Go language installation and uninstallation
In 2021, China's private equity market is growing, and the scale of private equity fund management reaches 19.78 trillion yuan [figure]
On location and scale in CNN
Sorting out the latest data mining competition scheme!
Tcp/ip test questions (III)
QQ robot official plug-in loading configuration method [beta2 version]
[C language practice - print the upper triangle and its deformation (with blank version)]
Guangzhou Sinovel interactive creates VR Exhibition Hall panoramic online virtual exhibition hall
LeetCode-101-对称二叉树
Network security detection and prevention exercises (III)
Dependency injection in PHP reflection implementation framework
Using flex to implement the Holy Grail layout is as simple as that
Solidity get quarterly time
Kotlin compose terminate todo project Click to edit and modify todo
R language plot visualization: plot visualization of two-dimensional histogram contour (basic 2D histogram contour)
Mysql database design suggestions