标签:
1.js代码:
var checkPlat={
isAndroid: function (ua) {
ua = ua || navigator.userAgent;
return ua.toLowerCase().indexOf(‘android‘) > -1;
},
isIOS: function (platform) {
if (navigator && navigator.platform) {
platform = platform || navigator.platform;
// return /iP(?:hone|od|ad)/.test(platform);
return /iP(?:hone|od|ad)/.test(navigator.userAgent);
} else {
return false;
}
},
isWeixin: function (ua) {
ua = ua || navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
}
2.添加跳转的链接
$(function () {
$("#dian_c2").bind("click", function (e) {
var e = e || event, tar = e.target || e.srcElement, s = $(this);
window.location.assign("//要跳转链接");
e.stopPropagation();
});
});
微信浏览器打开 点击下载app 无需提示使用浏览器打开--代码分享
标签:
原文地址:http://www.cnblogs.com/fcan/p/4742600.html