functiongetquerystring (name) {varReg =NewRegExp ("(^|&)" + name + "= ([^&]*) (&|$)", "I"); varr = Window.location.search.substr (1). Match (REG); if(r! =NULL)return(R[2]);return NULL;}varOpenID = getquerystring ("OpenID");varindex = getquerystring ("index");functionIswappage () {varSuseragent =navigator.userAgent.toLowerCase (); varBisipad = Suseragent.match (/ipad/i) = = "ipad"; varBisiphoneos = Suseragent.match (/iphone os/i) = = "iphone OS"; varBISMIDP = Suseragent.match (/midp/i) = = "MIDP"; varBIsUc7 = Suseragent.match (/rv:1.2.3.4/i) = = "rv:1.2.3.4"; varBISUC = Suseragent.match (/ucweb/i) = = "UCWeb"; varBisandroid = Suseragent.match (/android/i) = = "Android"; varBisce = Suseragent.match (/windows ce/i) = = "Windows CE"; varBISWM = Suseragent.match (/windows mobile/i) = = "Windows Mobile"; varBISWP = Suseragent.match (/windows phone/i) = = "Windows Phone"; //var iswap = (Bisipad | | bisiphoneos | | bismidp | | bIsUc7 | | bisuc | | bisandroid | | bisce | | biswm | | biswp); //return iswap; if(Bisipad | | bisiphoneos | | bismidp | | bIsUc7 | | bisuc | | bisandroid | | bisce | | biswm | |biswp) { Switch(index) { Case"Authorization": window.location.href = "authorization.html?openid=" + openId; Break; Case"Reportexcption": window.location.href = "reportexcption.html?openid=" + openId; Break; Case"Excptiondetails": window.location.href = "reportrecord.html?openid=" + openId; Break; default: Break; } } Else{window.location.href= "Errorwarning.html"; }}
JS Verify that the useragent is from the mobile side