美文网首页
js调起iOSApp使用window.location.href

js调起iOSApp使用window.location.href

作者: 生命不止运动不息 | 来源:发表于2023-06-23 15:35 被阅读0次

在html中通过js调起App,但使用window.location.href跳转无效

通过universal link方式,访问通用链接,调起App

原方法无效:
window.location.href = ''

解决方案,将window去掉

location.href = ''

例如:
let url = 'https://vbukom.xinstall.com.cn/tolink'
location.href = url

在iframe内部,使用href跳转失败问题

解决方案:top属性直接获取顶层的父窗口

//如果窗口没有父窗口,则top是对自身的引用(窗口=== window.top)
window.top.location.href = ''

相关文章

网友评论

      本文标题:js调起iOSApp使用window.location.href

      本文链接:https://www.haomeiwen.com/subject/stkvydtx.html