前段时间做了个项目,里面关于手机移动端下载的问题

开始是判断微信、ios和android系统的下载

因为微信屏蔽点击事件和链接的缘故,需要通过打开新页面来进行下载

ios和android的下载分别为不同的问题。代码如下:

<script type="text/javascript">
var is_weixin = (function() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {//判断浏览器是否是微信
return true;
} else {
return false;
}
})();
window.onload = function(){
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; 
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
var down = document.getElementById('J_weixin');
var down2 = document.getElementById('J_weixin00');
if (isAndroid){
down.setAttribute("href", "http://120.26.207.142:8080/WeizhifuAPI/GetNewVersionFile");
down2.setAttribute("href", "http://120.26.207.142:8080/WeizhifuAPI/GetNewVersionFile");
}
if (isiOS){ 
down.setAttribute("href", "itms-services://?action=download-manifest&url=https://vinpush2012.sinaapp.com/plist/wtx.plist");
down2.setAttribute("href", "itms-services://?action=download-manifest&url=https://vinpush2012.sinaapp.com/plist/wtx.plist");
}

var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
var btn = document.getElementById('J_weixin');
var btn2 = document.getElementById('J_weixin00');
var tip = document.getElementById('weixin-tip');
var close = document.getElementById('close');

if(is_weixin){
btn.onclick = function(e){
tip.style.height = winHeight + 'px';
tip.style.display = 'block';
return false;
}
btn2.onclick = function(e){
tip.style.height = winHeight + 'px';
tip.style.display = 'block';
return false;
}
close.onclick = function(){
tip.style.display = 'none';
}
}

}

</script>

然后问题解决了,你觉得万事大吉了,真是太天真了!!!!

上线以后,问题又来了。

因为ipad和ipone版本问题,下载链接又出问题了

出现了加密和解密的问题,我要怎么解决,我去。

最新文章

  1. java执行linux命令
  2. GDAL关于读写图像的简明总结
  3. Python自动化 【第六篇】:Python基础-面向对象
  4. cocos2dx实现经典飞机大战
  5. 局域网之php项目IP访问共享
  6. 浅谈mapreduce程序部署
  7. 3-jQuery - AJAX get()
  8. gitignore的使用
  9. App Technical Support
  10. mysql概述
  11. 学习 vue 源码 -- 响应式原理
  12. MTK NTP和NITZ更新时间的问题
  13. 20172302 《Java软件结构与数据结构》实验二:树实验报告
  14. LeetCode 905 Sort Array By Parity 解题报告
  15. html5-css综合练习
  16. 【转】Java迭代:Iterator和Iterable接口
  17. PostgreSQL杂记页
  18. shell脚本常用参数
  19. sql server 存储过程基础知识
  20. Mirror--如何TSQL查看镜像状态和镜像相关存储过程

热门文章

  1. 团体程序设计天梯赛-练习集-L1-025. 正整数A+B
  2. centos7常见的操作
  3. U盘启动盘安装Mac OS
  4. BZOJ 1355: [Baltic2009]Radio Transmission AC自动机/KMP
  5. BZOJ 3144 [HNOI2013]切糕 (最大流+巧妙的建图)
  6. [剑指offer] 29. 顺时针打印矩阵 (for循环条件)
  7. SpringBoot 配置 @ConfigurationProperties 与 @Value 区别
  8. UVA11827 Maximum GCD
  9. BA-siemens-insight_designer不支持win7 64位操作系统
  10. ISAM Indexed Sequential Access Method 索引顺序存取方法