Method One: PureJSJudge
Using this method is both simple and practical, without the need to introduce the jquery library and add the following code to the
<script type= "Text/javascript" >if (/android|webos|iphone|ipad|ipod| blackberry| iemobile| Opera mini/i.test (navigator.useragent)) {window.location = "mobile.html";//Can be replaced with an HTTP address}</script>
Method Two: Use Device.JSLibrary
Device. JS is a device used to check the plug-in, using it you can easily determine the device's operating system, as well as whether the device is portrait or landscape.
First, we download the device. JS
: Https://github.com/matthewhudson/device. JS
STEP 1: IntroductionJSFile
<script src= "Device.min.js" ></script>
STEP 2: Add judgmentCode
<script type= "Text/javascript" >if (Device.mobile ()) {window.location = "shouji.html"; Can be replaced with an HTTP address}</script>
Device. There are many JS methods, if you want to implement the judgment of a device, to replace device.mobile () according to the following code .
650) this.width=650; "alt=" JS to determine the best method of mobile device and to jump to the mobile version of the page "src=" http://static.open-open.com/lib/uploadImg/20151204/ 20151204211230_444.png "width=" "height=" 854 "style=" border:0px;vertical-align:middle; "/>
JS to determine the best way to move devices and to jump to the mobile version of the Web page