h5唤起app

h5唤起app,第1张

概述<!DOCTYPE html> <html> <!-- 经测试,android iosok了 --> <head> <meta charset="UTF-8"> <title>网页呼叫app</title> <style> #zjmobliestart { font-size: 40px; } </style> </head> <body> <a onclick="util.tuneUpApp()

<!DOCTYPE HTML>
<HTML>
<!-- 经测试,androID iosok了 -->
<head>
<Meta charset="UTF-8">
<Title>网页呼叫app</Title>
<style>
#zjmoblIEstart {
Font-size: 40px;
}
</style>
</head>

<body>
<a onclick="util.tuneUpApp()" href="will://">clickme</a>
<script>
var util = {};
util.tuneUpApp = function () {
var browser = {    
versions: function () {         
var u = navigator.userAgent,
            app = navigator.appVersion;         
return {              
trIDent: u.indexOf(‘TrIDent‘) > -1,
             /*IE内核*/               presto: u.indexOf(‘Presto‘) > -1,
      /*opera内核*/               webKit: u.indexOf(‘AppleWebKit‘) > -1,
/*苹果、谷歌内核*/
              gecko: u.indexOf(‘Gecko‘) > -1 && u.indexOf(‘KHTML‘) == -1,
     /*火狐内核*/               mobile: !!u.match(/AppleWebKit.*Mobile.*/),
     /*是否为移动终端*/               ios: !!u.match(/\(i[^;]+;( U;)? cpu.+Mac OS X/),
/*ios终端*/
              androID: u.indexOf(‘AndroID‘) > -1 || u.indexOf(‘linux‘) > -1,
/*androID终端或者uc浏览器*/
              iPhone: u.indexOf(‘iPhone‘) > -1,
      /*是否为iPhone或者QQHD浏览器*/               iPad: u.indexOf(‘iPad‘) > -1,
    /*是否iPad*/               webApp: u.indexOf(‘Safari‘) == -1,
      /*是否web应该程序,没有头部与底部*/               souyue: u.indexOf(‘souyue‘) > -1,
              superapp: u.indexOf(‘superapp‘) > -1,
              weixin: u.tolowerCase().indexOf(‘micromessenger‘) > -1,
              Safari: u.indexOf(‘Safari‘) > -1          
};     
}(),
language: (navigator.browserLanguage || navigator.language).tolowerCase()
};

if (browser.versions.ios) {
location.href = ‘will://‘;
setTimeout(function () {
location.href = ‘http://192.168.0.140:8080/HTML/download.HTML‘;
},1000);
setTimeout(function () {
location.reload();
},1000);
} else if (browser.versions.androID) {
var startTime = Date.Now();
var ifr = document.createElement(‘iframe‘);
ifr.src = "will://share/testID";
ifr.style.display = ‘none‘;
document.body.appendChild(ifr);
var t = setTimeout(function () {
var endTime = Date.Now();
if (!startTime || endTime - startTime < 600 + 200) {
window.location = ‘http://192.168.0.140:8080/HTML/download.HTML‘;
} else {

}
},1000);
window.onblur = function () {
clearTimeout(t);
}
}
}
</script>
</body>

</HTML>

总结

以上是内存溢出为你收集整理的h5唤起app全部内容,希望文章能够帮你解决h5唤起app所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1057713.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存