1、使用iframe
let ifr = document.createElement('iframe'); ifr.src = 'test123://'; ifr.style.display = 'none'; document.body.appendChild(ifr); this.downloadTimer = setTimeout(()=>{ document.body.removeChild(ifr) this.clearTimer() },3000);
2、直接window.location
window.location.href = 'test123://'
3、模拟<a>标签点击
let aLink = document.createElement('a') aLink.href = 'test123://' document.body.appendChild(aLink) aLink.click()
4、ios环境下唤起已上架的app
先判断当前环境为ios,然后使用itms-appss://itunes.apple.com/app/apple-store/xxxxxx
有朋自远方来...评论一下呗O(∩_∩)O