I am trying to put my mobile Website into PhoneGap to create a "native" app. Therefore I start googling and found that onDeviceReady window.location should solve this.
this solution was e.g. described here already: http://antonylees.blogspot.de/2013/02/launch-website-as-mobile-app-using.html
However following the Option 2 (which just consits of window.location) solution, it does not work. The alerts are shown but window.location not works, which means it does not show the new window location, but just the original phonegap loading screen. (alert of current page contains same message as alert after)
Any ideas?
this is the relevant code part of index.js
onDeviceReady: function() {
app.receivedEvent('deviceready');
alert(window.location.href); //current page
window.location = "https://www.google.com";
alert(window.location.href); //page after location set
},
this ist the relevant part of config.xml
<access origin="*"/>
<allow-navigation href="*" />
Oh, I just installed the latest phonegap for windows, created a new project and just did changed index.js as can be seen above.
thx a lot