Function Android () { window.location.href = "Open App protocol";/*** Open App Protocol, Android colleague provides ***/ window.settimeout (function { window.location.href = "Download the app's address";/***android mobile ***/ },2000);} function iOS () { var IFR = document.createelement ("iframe"); IFR.SRC = "Open the app's protocol"; /*** Open the App protocol, have iOS colleague provided ***/ Ifr.style.display = "None"; Document.body.appendChild (IFR); Window.settimeout (function () { document.body.removeChild (IFR); window.location.href = "Download the app's address"; /*** Download app address ***/ },2000)}var u = window.navigator.useragent;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/); if (isandroid) { android ();} if (Isios) { iOS (); }
JS to determine if there is a client on the mobile side: open if it exists, download if it does not exist