What is the alternative to `alert` in metro apps?

前端 未结 3 1522
有刺的猬
有刺的猬 2021-01-14 20:55

I created my first app on Windows 8 vs 2012 and it runs and works fine. But when I try to say \"helloworld\" from JavaScript like this:

alert(\"Hello World\         


        
3条回答
  •  情书的邮戳
    2021-01-14 21:12

    Remember that alert is not a JavaScript function, it's a browser (host) function, therefore, it's not available in non browser environments.

    This link tells you to do the following

    • Replace all alert functions with firing an event window.external.notify("message");

    • Use scriptnotify event in webview to get that message.

    • Show metro own dialog: MessageDialog

提交回复
热议问题