部分浏览器不支持,比如百度
function openWx(){ locatUrl = "weixin://"; if(/ipad|iphone|mac/i.test(navigator.userAgent)) { var ifr =document.createElement("iframe"); ifr.src = locatUrl; ifr.style.display = "none"; document.body.appendChild(ifr); }else{ window.location.href = locatUrl; } }
评论前必须登录!
注册