


Share two mobile phones to access the PC website and automatically jump to the mobile website code_javascript skills
With the advent of 4G, mobile websites have become out of control, with PC and mobile official websites coexisting. How to let others visit your PC official website jump directly to the mobile website? Dear readers, waiter, please code! Coming!
The first method: You need to synchronize the data on the mobile phone and the web page
Second method:
<SCRIPT LANGUAGE="JavaScript"> function mobile_device_detect(url) { var thisOS=navigator.platform; var os=new Array("iPhone","iPod","iPad","android","Nokia","SymbianOS","Symbian","Windows Phone","Phone","Linux armv71","MAUI","UNTRUSTED/1.0","Windows CE","BlackBerry","IEMobile"); for(var i=0;i<os.length;i++) { if(thisOS.match(os[i])) { window.location=url; } } //因为相当部分的手机系统不知道信息,这里是做临时性特殊辨认 if(navigator.platform.indexOf('iPad') != -1) { window.location=url; } //做这一部分是因为Android手机的内核也是Linux //但是navigator.platform显示信息不尽相同情况繁多,因此从浏览器下手,即用navigator.appVersion信息做判断 var check = navigator.appVersion; if( check.match(/linux/i) ) { //X11是UC浏览器的平台 ,如果有其他特殊浏览器也可以附加上条件 if(check.match(/mobile/i) || check.match(/X11/i)) { window.location=url; } } //类in_array函数 Array.prototype.in_array = function(e) { for(i=0;i<this.length;i++) { if(this[i] == e) return true; } return false; } } mobile_device_detect("http://***.***.com"); </SCRIPT>
Remark here
mobile_device_detect("http://***.***.com");//The address inside is the website address of your mobile terminal.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





How to use NginxProxyManager to implement automatic jump from HTTP to HTTPS. With the development of the Internet, more and more websites are beginning to use the HTTPS protocol to encrypt data transmission to improve data security and user privacy protection. Since the HTTPS protocol requires the support of an SSL certificate, certain technical support is required when deploying the HTTPS protocol. Nginx is a powerful and commonly used HTTP server and reverse proxy server, and NginxProxy

How to solve the problem that Google Chrome automatically jumps? Google Chrome is the most popular web browser software today. This browser is very powerful and relatively stable to operate. After many friends download and install Google Chrome, they will always jump to when clicking on a web link. In the browser that comes with the computer, this kind of problem greatly affects the user experience, so we need to change the default browser of the computer to Google Chrome. This article will give you a detailed explanation of how to solve the problem of automatic redirection in Google Chrome. Let’s take a look. How to solve the problem of automatic redirection in Google Chrome: 1. Click on the lower left side of the computer: Start—Control Panel (as shown in the picture). 2. After entering the control panel, select: Programs (as shown in the picture). 3. Select Default Program: Set Default Program (as shown in the picture)

How to restore IE browser to automatically jump to edge? When we open the Internet Explorer browser, it always jumps to the Edge browser. What should we do in this case? Recently, when some users open the IE browser, they will jump directly to the edge browser, which cannot be opened smoothly, resulting in the inability to use the edge browser. How should we solve this situation? The editor has compiled the automatic jump of the IE browser below. Turn to edge recovery skills, if you don’t know how, follow the editor to read below! IE browser automatically jumps to edge recovery tips 1. After opening IE browser first, it automatically jumps to Edge browser, as shown in the figure. 2. Let’s stop it from jumping. Open the Edge browser, click the three dots in the upper right corner, and select "Settings", as shown in the picture

How to solve the problem of mobile keyboard blocking input box in Vue development. With the popularity of mobile devices, more and more web applications are widely used on mobile phones. However, during development, we often encounter a very common problem, that is, the keyboard on the mobile phone blocks the input box. When the user uses the input box to input, if the keyboard blocks the input box, it will cause inconvenience and trouble to the user. How to solve this problem in Vue development? Below, I'll introduce a few solutions. Solution 1: Use vue-keyboar

Setting method: 1. Log in to the control panel of the domain name registrar; 2. Find the domain name management page; 3. Find the domain name resolution settings; 4. Add resolution records; 5. Set jump rules; 6. Save the settings.

With the rapid development of mobile Internet, more and more websites are beginning to adopt mobile development. In mobile phone development, sliding to switch pages is a common requirement. As a popular front-end framework, Vue provides us with a convenient solution to achieve sliding switching pages. In Vue development, we usually use VueRouter to manage page routing. VueRouter provides a router-link component that can easily jump between pages. But on the mobile side, we

How to choose the appropriate CSS framework on mobile phones? With the popularity of mobile devices and the rapid development of the Internet, more and more people browse the Internet through their mobile phones. In order to present a good user experience on mobile phones, developers need to choose a suitable CSS framework for development. This article will introduce how to choose the appropriate CSS framework on the mobile phone to help developers better develop mobile web pages. 1. Understand different CSS frameworks Before choosing a CSS framework, you first need to understand different CSS frameworks. Common CSS at the moment

As a website owner or developer, there may be times when you need to automatically move visitors to a new web page. Whether it's because you've moved the page to a new URL or want to redirect visitors to a different part of your site, there are a few different methods you can use to accomplish this. In this article, we'll explore the different types of redirects you can use to automatically move visitors to a new web page, and provide examples of how to implement each. Meta Refresh Redirects One of the easiest ways to redirect visitors to a new web page is to use meta refresh redirects. This is done by adding an HTML tag to the head section of the web page that tells the browser to redirect to a new URL after a specified time delay. Example<!DOCTYPEhtml>
