I want to have only one view in my iOS phonegap app.
This view will be a web page.
How can i load this only view with a specific url?
I suppose you do that through javascript and if yes how?
*I am not an html/javascript scripter , i only develop native iOS applications , but i need to test something with phonegap.
PhoneGap which is now called Apache Cordova on iOS will only let you use a file URL by default. This means you have to load a local .html file. If you want to open a remote page with an http:// URL, you'll need to add custom native code to tell the WebView to load a remote URL.
d0nparalias,
If you want to load main(Cordova's)
index.html
from remote server, editconfig.xml
file and change<content src="index.html" />
to
<content src="http://192.168.1.4:8080/www/index.html" />
for example. And it will load
index.html
from web server located on 192.168.1.4.If you want to open a website right after loading your app, you can use InAppBrowser as you have already noticed.
window.open(url, target, options);
Here you have options for
target
(according to Cordova docs 2.5.0):2.1.
![enter image description here](https://i.stack.imgur.com/dTvbP.png)
_self
and you'll get something likeNote, that you don't have any controls to return to your
index.html
in this case.2.2.
![enter image description here](https://i.stack.imgur.com/HZZMx.png)
_blank
— presents modal view controller with dismiss button2.3.
![enter image description here](https://i.stack.imgur.com/Hq7sl.png)
_system
— opens in Safari.appFor more information visit documentation and wiki.
Hope it helps.
BR.
Eugene