次のようなコードがあります。
webBrowser.IsScriptEnabled = true;
webBrowser.InvokeScript("eval", "alert('hey')");
を与えAn unknown error has occurred. Error: 80020006
ます。このエラーを修正する方法を教えてください。
次のようなコードがあります。
webBrowser.IsScriptEnabled = true;
webBrowser.InvokeScript("eval", "alert('hey')");
を与えAn unknown error has occurred. Error: 80020006
ます。このエラーを修正する方法を教えてください。
Windows Phone には組み込みのブラウザーはありませんwindow.alert
が、次のようにバインドして呼び出すことができます。WebBrowser.ScriptNotify
//inside the page
window.alert = function (__msg) { window.external.notify(' + __msg + '); };
// in your C# code
this.webBrowser.ScriptNotify += new EventHandler<NotifyEventArgs>(Browser_ScriptNotify);
void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
MessageBox.Show(e.Value);
}
//later
this.CordovaView.Browser.IsScriptEnabled = true;
this.CordovaView.Browser.InvokeScript("alert", "ok");
Cordova には、プラグインできる通知プラグインもあります。
window.alert = navigator.notification.alert;
config.xmlで通知プラグインを有効にしてください
<feature name="Notification">
<param name="wp-package" value="Notification"/>
</feature>