I’m trying out PhoneGap 1.4 on Windows Phone 7.5 using jQuery mobile (1.0.1.).
Basic navigation is working, unfortuantely I can’t seem to get alerts working. Neither alert(“string); nor PhoneGap’s navigator.notification.alert(message, alertCallback, [title], [buttonName]); get me any response. The PhoneGap test message is being displayed fine. This is the way I try to call it:
function init()
{
document.addEventListener("deviceready",onDeviceReady,false);
}
function onDeviceReady()
{
document.getElementById("welcomeMsg").innerHTML += "PhoneGap is ready!";
alert('test');
navigator.notification.alert(
'You are the winner!', // message
alertDismissed, // callback
'Game Over', // title
'Done' // buttonName
);
}
See this Google Groups discussion.
In short, Windows Phone 7 IE9 web browser doesn’t support alerts, and instead you must use the PhoneGap Notification API, like this:
For further information, see the PhoneGap Notification API.