> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
<script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
<script type="text/javascript" src="jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="flot/jquery.flot.min.js"></script>
<script type="text/javascript" src="flot/jquery.flot.stack.min.js"></script>
<script type="text/javascript" src="flot/jquery.flot.pie.min.js"></script>
<link rel="stylesheet" href="jquery.mobile-1.0.1.min.css" />
<script type="text/javascript" src="jquery.mobile-1.0.1.min.js"></script>
<link rel="stylesheet" href="jquery.mobile.tabs.css" />
<script type="text/javascript" src="jquery.mobile.tabs.js"></script>
<script type="text/javascript">
function onDeviceReady() {
alert("Hi");
}
document.addEventListener('deviceready', onDeviceReady, false);
</script>
1. Make sure you are using the BlackBerry version of phonegap.js.
Each platform has a specific javascript file.
2. The recommended way to add a listener for deviceready is the following:
<script type="text/javascript" charset="utf-8">
function onload() {
// Wait for PhoneGap to load
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
// do stuff
}
</script>
<body onload="onload()">
3. If #1 or #2 do not help, try removing the other script inclusions.
Maybe one of them is conflicting with phonegap.
Custom events are not supported in the RIM BrowserField (web browser view), so the deviceready event will never fire.
A workaround is to manually query PhoneGap.available until PhoneGap has fully loaded.
function onLoad() {
// BlackBerry OS 4 browser does not support events.
// So, manually wait until PhoneGap is available.
//
var intervalID = window.setInterval(
function() {
if (PhoneGap.available) {
window.clearInterval(intervalID);
onDeviceReady();
}
},
500
);
}
function onDeviceReady() {
// Now safe to use the PhoneGap API
}Now I am completely confused. Originally you referenced OS 6. Your
most recent reply references OS 4. OS 4 is no longer being actively
supported by PhoneGap and PhoneGap 1.4.1 certainly will not work on OS
4. 'deviceready' does in fact fire on OS 5, 6, 7 devices.