In regards to Cordova 3.4:
I have come across various posts on the internets about doing a remote load of a webpage with cordova/phonegap and I have not been able to get it to work. I have read questions #28 and #29 on github and various other posts.
I am loading the url directly via the content setting in config.xml (the below example is on my local dev machine, but doesn't matter which url I use within our corporate firewall). I have also tried doing a window.location to the url, but that doesn't work either.
<content src="http://192.168.96.97:3004/#reference" />
The page loads fine except for the deviceready event doesn't fire. The www files local to the cordova app works, just nothing remote.
I get:
deviceready has not fired after 5 seconds. cordova.js?body=1:1117
Channel not fired: onCordovaInfoReady cordova.js?body=1:1110
Channel not fired: onCordovaConnectionReady cordova.js?body=1:1110
Here is my code:
<html><head>
<title>Cordova Test</title>
<script src="cordova.js"></script>
<script src="cordova_plugins.js"></script>
<script src="plugins/org.apache.cordova.device/www/device.js"></script>
<script src="plugins/org.apache.cordova.geolocation/www/Coordinates.js"></script>
<script src="plugins/org.apache.cordova.geolocation/www/PositionError.js"></script>
<script src="plugins/org.apache.cordova.geolocation/www/Position.js"></script>
<script src="plugins/org.apache.cordova.geolocation/www/geolocation.js"></script>
<script src="plugins/org.apache.cordova.network-information/www/network.js"></script>
<script src="plugins/org.apache.cordova.network-information/www/Connection.js></script>
<script>
// Wait for device API libraries to load
function onLoad() {
alert("onload..."); // this displays
document.addEventListener("deviceready", onDeviceReady, false);
}
// device APIs are available
function onDeviceReady() { // this never fires
// Now safe to use device APIs
alert("deviceready...");
console.log("deviceready...");
}
</script>
</head>
<body onload="onLoad();" style="">
hello! :)
</body></html>
Thanks!