7 html javascript url ios cordova
我想在我的iOS phonegap应用中只有一个视图.
该视图将是一个网页.
如何使用特定网址加载此视图?
我想你通过javascript做到这一点,如果是的话怎么样?
*我不是一个html/javascript脚本,我只开发本机iOS应用程序,但我需要用phonegap测试一些东西.
dym*_*ymv 16
d0nparalias,
如果要加载主(科尔多瓦的)index.html从远程服务器,编辑config.xml文件,并改变
<content src="index.html" />
以
<content src="http://192.168.1.4:8080/www/index.html" />
为例.它将index.html从位于192.168.1.4的Web服务器加载.
如果您想在加载应用程序后立即打开网站,可以使用InAppBrowser,因为您已经注意到了.
window.open(url, target, options);
在这里你可以选择target(根据Cordova docs 2.5.0):
2.1._self你会得到类似的东西
请注意,index.html在这种情况下,您没有任何控件可以返回给您.
2.2._blank - 使用关闭按钮呈现模态视图控制器
2.3._system - 在Safari.app中打开
希望能帮助到你.
BR.
尤金