I’ve tried to fire an alert on document.ready in a JavaScript file but the alert didn’t fire when testing on Windows Phone 7 emulator.
btw I uses PhoneGap 2.2.0, JS, and HTML
here is my code
$(document).ready(function () {
alert("Hello World WP7");
initPlateImage();
});
also I’ve tried
window.alert = navigator.notification.alert;
and
navigator.notification.alert("Hi");
but no use, Any suggestions
Thanks!
Probably Cordova is not initialized at the time you call alert(). Try the following way – “deviceready” is an Cordova specific event telling you that Cordova is successfully initialized