阅读背景:

web页面打开本地app(判断是否安装)

来源:互联网 

在应用宝中有APP申请链接:

//是否可以打开App不可以跳则到下载页
$(".downNow button").on("click",function(){
	if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i))
    {
	    var loadDateTime = new Date().getTime();
	    window.setTimeout(function() {
		    var timeOutDateTime = new Date().getTime();
		    // alert("loadDateTime:"+loadDateTime+"--"+"timeOutDateTime"+timeOutDateTime)
	        if (timeOutDateTime - loadDateTime < 3000) {
	            window.location.href = "http:";//下载链接
		    } else {
		        window.close();
		    }
	 	},1500);
	    window.location.href = "baoxianquan://";//ios app协议
    }
	if(navigator.userAgent.match(/android/i))
	{
		var loadDateTime = new Date().getTime();
	    window.setTimeout(function() {
		    var timeOutDateTime = new Date().getTime();
		     // alert("loadDateTime:"+loadDateTime+"--"+"timeOutDateTime"+timeOutDateTime)
	        if (timeOutDateTime - loadDateTime < 3000) {
	            window.location.href = "http:";//下载链接
		    } else {
		        window.close();
		    }
	 	},1500);
	    window.location.href = "bxq://com.tou360.insurcircle";//android app协议
	    //jxapi://com.tou360.bida/
	    // window.setTimeout(function() {
	    // 	var timeOutDateTime = new Date();
	    // 	if((timeOutDateTime-loadDateTime)<3000){
	    // 		window.location.href = "https://a.app.qq.com/o/simple.jsp?pkgname=com.tou360.bidaagent";//android 下载地址
	    // 	}  
	    // }, 2000)    
	}
});
//是否可以打开App不可以跳则到下载页
$(".d



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: