我正在开发一个带有退出按钮的windows应用程序,用于退出带有确认的应用程序。该按钮使用html5、jquery-mobile、ajax和phonegap放在应用程序的顶部。问题出在我身上,我使用了下面写的代码,它在windows app中不起作用。甚至连警报都不起作用。
所以我用了
var msg = new Windows.UI.Popups.MessageDialog("No image is selected");
msg.showAsync();而且它运行得很好。有人能帮我找出这个问题吗?
navigator.notification.confirm("Do you really want to close this app?", function (buttonIndex) {
ConfirmExit(buttonIndex);
},
"Confirmation",
"Yes,No"
);
function ConfirmExit(stat) {
alert("Inside ConfirmExit");
if (stat == "1") {
navigator.app.exitApp();
} else {
return;
};
};发布于 2015-06-09 20:48:23
你调用函数的方式,还有警报!
我还没试过这个,但我想你可以试一试
navigator.notification.confirm("Do you really want to close this app?"
, ConfirmExit,
"Confirmation",
["Yes","No"]
);还有一个navifator.notification.alert用来提醒消息
function ConfirmExit(stat) {
//alert("Inside ConfirmExit");
navigator.notification.alert("Inside ConfirmExit", null, "Alert", null)
if (stat == "1") {
navigator.app.exitApp();
}
};https://stackoverflow.com/questions/30730274
复制相似问题