Web home page Set the following code to determine the user is using what device login?

Source: Internet
Author: User

var onepage=true;//is used to judge the information of the first page login in Statichtml.js
var _mobileurl = "http://www.m.90tuku.com";//Mobile phone users to visit the site through the hungry time jump
Checkmobiledevice ();//Call Monitoring code

function IsMobileDevice () {
Return (Navigator.userAgent.match (/android/i) | | navigator.userAgent.indexOf (' iPhone ') >-1 | | Navigator.userAgent.indexOf (' IPod ') >-1 | | Navigator.userAgent.indexOf (' IPad ') >-1);
}
function Isfromwap () {
Return (Location.href.indexOf ("From=wap") >-1);
}
function Checkmobiledevice () {
var MobileDevice = IsMobileDevice ();//Check if it's a handheld device.
if (MobileDevice) {
var formwap = Isfromwap ();
if (fromwap!= "Fromwap") {//Check whether it is sent on the phone to log in to the PC URL
if (!formwap) {
Location.href = _mobileurl;
return false;
}
//}
}
}

Web home page Set the following code to determine the user is using what device login?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.