js浏览器问题
前段时间做了个项目,里面关于手机移动端下载的问题
开始是判断微信、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版本问题,下载链接又出问题了
出现了加密和解密的问题,我要怎么解决,我去。
最新文章
- java执行linux命令
- GDAL关于读写图像的简明总结
- Python自动化 【第六篇】:Python基础-面向对象
- cocos2dx实现经典飞机大战
- 局域网之php项目IP访问共享
- 浅谈mapreduce程序部署
- 3-jQuery - AJAX get()
- gitignore的使用
- App Technical Support
- mysql概述
- 学习 vue 源码 -- 响应式原理
- MTK NTP和NITZ更新时间的问题
- 20172302 《Java软件结构与数据结构》实验二:树实验报告
- LeetCode 905 Sort Array By Parity 解题报告
- html5-css综合练习
- 【转】Java迭代:Iterator和Iterable接口
- PostgreSQL杂记页
- shell脚本常用参数
- sql server 存储过程基础知识
- Mirror--如何TSQL查看镜像状态和镜像相关存储过程
热门文章
- 团体程序设计天梯赛-练习集-L1-025. 正整数A+B
- centos7常见的操作
- U盘启动盘安装Mac OS
- BZOJ 1355: [Baltic2009]Radio Transmission AC自动机/KMP
- BZOJ 3144 [HNOI2013]切糕 (最大流+巧妙的建图)
- [剑指offer] 29. 顺时针打印矩阵 (for循环条件)
- SpringBoot 配置 @ConfigurationProperties 与 @Value 区别
- UVA11827 Maximum GCD
- BA-siemens-insight_designer不支持win7 64位操作系统
- ISAM Indexed Sequential Access Method 索引顺序存取方法