我正在使用 jQuery mobile (1.0.1.) 在 Windows Phone 7.5 上试用 PhoneGap 1.4。 基本导航工作正常,不幸的是我似乎无法让警报正常工作。 alert("string); 和 PhoneGap 的 navigator.notification.alert(message, alertCallback, [title], [buttonName]); 都没有得到任何回应。PhoneGap 测试消息显示正常。这是我尝试调用的方式它:
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
);
}
最佳答案
查看此 Google Groups discussion .
简而言之,Windows Phone 7 IE9 网络浏览器不支持警报,您必须使用 PhoneGap Notification API,如下所示:
navigator.notification.alert("Message", callBackMethod, "Title", "Button Text");
有关详细信息,请参阅 PhoneGap Notification API .
关于windows-phone-7 - alert() 不适用于 Windows Phone 上的 PhoneGap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9311270/