<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>调起网易新闻app</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content="yes" name="apple-touch-fullscreen">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no" /> <style>
a {
display: block;
width: ;
text-decoration: none;
background-color: #20A0FF;
text-align: center;
height: 2rem;
line-height: 2rem;
margin: 3rem auto;
}
</style>
</head> <body>
<a id="openApp">使用网易新闻客户端打开</a>
<script>
var s = document.getElementById("openApp");
s.onclick = function() {
var url = 'newsapp://topic/S1515729142180?s=jiguang&spsug=ug&spsugdate=0&spsugextend=0';
testApp(url);
}
function testApp(url) {
var timeout, hasApp = true;
var t1 = Date.now();
var ifr = document.createElement("iframe");
ifr.setAttribute('src', url);
ifr.style.display = "none";
document.body.appendChild(ifr);
timeout = setTimeout(function() {
var t2 = Date.now();
if(t2 - t1 < 2000) {
hasApp = false;
if(is_IOS()) {
location.href = "http://3g.163.com/links/4633";
return;
}
location.href = "http://3g.163.com/links/4636";
}
}, 1000); location.href = url;
}
function is_IOS() {
var userAgent = 'navigator' in window && 'userAgent' in navigator && navigator.userAgent.toLowerCase() || '';
if(/iphone/i.test(userAgent) || /ipad/i.test(userAgent) || /ipod/i.test(userAgent)) {
return true
} else {
return false;
};
}
</script>
</body> </html>

  

最新文章

  1. Android开发学习之路-Android中使用RxJava
  2. eclipse安装版本
  3. Greenplum记录(一):主体结构、master、segments节点、interconnect、performance monitor
  4. 如何排查APP服务端和客户端是否支持ATS
  5. .Net Framework 3.5, 3.5 sp1 中文版离线安装
  6. libpcap和WinPcap
  7. 使用VideoView自定义一个播放器控件
  8. MySQL中Group By,distinct使用注意事项
  9. 4-Highcharts 3D图之3D普通饼图
  10. 2016计蒜之道复赛 百度地图的实时路况 floyd+cdq分治
  11. hiho 1182 : 欧拉路&#183;三
  12. jquery mobile touch 实例
  13. IOS基金会_ UICollectionView简单易用
  14. LAMP on ubuntu12.04 PHP, Apache2, MySQL, Linux ( with phpmyadmin installed)
  15. Hibernate 系列教程9-自关联
  16. MySQL二进制日志总结
  17. 转:Java中finally和return的执行关系
  18. 为你的MacOS App添加开机自启动(Swift)
  19. GO值类型与引用类型
  20. nginx 日志 cron任务切割日志

热门文章

  1. TableView编辑状态下跳转页面的崩溃处理
  2. day14(xml 编写及解析)
  3. HDU1269 迷宫城堡 2016-07-24 13:47 84人阅读 评论(0) 收藏
  4. javascript 奇技淫巧45招
  5. spring boot搭建Hello Word
  6. Oracle sql 优化の常用方式
  7. JS——图片预览功能
  8. Godot开发环境与学习资源
  9. Unix下cp、tar、sudo命令的使用
  10. CentOS更改ssh端口