One: Judging is the kind of device
var isandroid = u.indexof (' Android ') >-1 | | U.indexof (' Linux ') >-1; Android Terminal or UC Browser
var Isios =!! U.match (/\ (i[^;] +;( U;)? Cpu.+mac OS x/); iOS terminal
Two: Android device: Principle: Judge whether to know this agreement, know the direct jump, do not know to download the app here
Android ();
if (isandroid) {
Function Android () {
Window.location.href = "OPENWJTR://COM.TYRBL.WJTR"; /*** opens the app protocol, with Android colleagues providing ***/
Window.settimeout (function () {
Window.location.href = "http://www.wjtr.com/download/index.html"; /*** opens the app protocol, with Android colleagues providing ***/
},2000);
};
Two: iOS device: principle: Ibid.
iOS ();
if (Isios) {
function iOS () {
var IFR = document.createelement ("iframe");
IFR.SRC = "OPENWJTR://COM.TYRBL.WJTR"; /*** Open the app protocol and have iOS colleagues provide ***/
Ifr.style.display = "None";
Document.body.appendChild (IFR);
Window.settimeout (function () {
Document.body.removeChild (IFR);
Window.location.href = "http://www.wjtr.com/download/index.html"; /*** Download the app's address ***/
},2000)
};
}
JS to determine if an app is installed on your mobile device