I’m writing a Windows 8 application in C# and XAML that hosts a Web page in a WebView. The Web page makes calls to alert() and confirm(), but the WebView throws exceptions, saying, “‘alert’ is undefined,” or “‘confirm’ is undefined.” Can alert() and confirm() be enabled, or do I need to write code to emulate their normal function? And if I need to write them myself, how should I begin such an undertaking? Thank you.
Share
You will need to write code to enable them. Note that this is true in a HTML5 Win8 app as well as XAML.
For script that can access WinRT, you can use Windows.UI.Popup.MessageDialog:
Note that these are async, and not block execution.
For acquiring information form the user — e.g text input from the user, there is nothing standard, and you’ll need to create a new set of mark up for that.