作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我使用时,我无法在 IOS 上的 cordova 应用程序中打开链接
window.open('http://maps.apple.com/?q='+label, '_system');
但它适用于(但不适用于浏览器):
window.location.href = 'http://maps.apple.com/?q='+label;
在我的 config.xml 中,我将其列入白名单:
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
在我的index.html中:
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">
我真的不明白这个问题..
谢谢
最佳答案
在我的 iOS Cordova 应用程序中,window.open() 仅当事件与触摸相关时才起作用,而不是与 onDeviceReady() 或 setTimeout() 等自动事件相关。
在 onclick() 事件之后执行 window.open 工作正常。
关于ios - Cordova - window.open 不适用于 IOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58944825/
我是一名优秀的程序员,十分优秀!