The PhoneGap sample for hooking the "deviceready" event works on my environments for BlackBerry and Android.
I now want this sample to work when the HTML file and supporting script is loaded from a remote web site. This works on Android but not on BlackBerry.
I'm using PhoneGap 1.5, WebWorks SDK 2.3.0.9 and a BB OS 7 simulator. I changed the config.xml to point to the remote HTML file with the line <content src="http://192.168.2.128/comunity/index3.html" />
.
I have also whitelisted the site by adding the line <access subdomains="true" uri="http://192.168.2.128/comunity" />
.
The relevant script looks like:
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
window.alert("deviceready");
}
Pointing the config to the local file causes an alert to display on the simulator. Pointing to the remote file only shows the HTML content. The local and remote files are exact copies. When I browse to the remote HTML file using Chrome I get script errors in the referenced PhoneGap script. This proves that the script reference is correct.
Any help appreciated.