我使用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应用程序中,仅当事件与触摸相关而不与onDeviceReady()或setTimeout()之类的自动化事件相关时,window.open()才起作用。
执行onclick()事件后执行window.open正常。