我想在我的 Cordova 应用程序启动时呈现远程 HTML 页面,而不是“./index.html”
在 config.xml 中试过
<content src="http://example.com/index.html" />
<access origin="*" />
还尝试将其放入 ./index.html
window.location.href = 'http://example.com/index.html';
当我启动应用程序时,两者都会加载空白屏幕。设备日志中没有错误。使用 Cordova 版本 5.3.3。
有什么想法吗?
最佳答案
如果你想使用<access origin="*" />
您需要将此元标记添加到您的 cordova 应用程序中的 html 页面:
<meta http-equiv="Content-Security-Policy" content="*">
希望对你有帮助!
关于android - 使用 Cordova 加载远程 index.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34941209/