【问题标题】:Exit windows app confirmation button not working退出 Windows 应用程序确认按钮不起作用
【发布时间】:2015-06-09 11:06:05
【问题描述】:

我正在开发一个带有退出按钮的 Windows 应用程序,以在确认后退出应用程序。该按钮使用 html5、jquery-mobile、ajax 和 phonegap 放置在应用程序的顶部。问题出在我身上,我使用了它在下面编写的代码并且在 Windows 应用程序中不起作用。 甚至警报也不起作用。

所以我用了

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;
};
};

【问题讨论】:

    标签: javascript jquery cordova jquery-mobile windows-mobile


    【解决方案1】:

    你调用函数的方式,以及警报!

    我没试过,但我想你可以试试

      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();
       }
     };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-06
      • 1970-01-01
      • 2012-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-16
      相关资源
      最近更新 更多