Windows Phone中的webview.InvokeSript时出现'System.SystemException'

时间:2013-10-17 16:57:19

标签: windows-phone-7 windows-phone-8

我正在使用以下代码来获取此异常

String title =(string)webBrowser.InvokeScript(“eval”,“document.getElementById('hdnTransactionId')。value;”);

我在WP7应用程序中使用WebBrowser控件并将IsScriptEnabled设置为true。然后,当尝试通过WebBrowser的InvokeScript调用脚本时,我得到了这个例外。

1 个答案:

答案 0 :(得分:0)

您必须编写一个适当的插件来调用应用程序中的脚本。 Silverlight环境允许您拨打Notify上的Window.external。以下是在应用程序中调用脚本的完整MSDN指南。

以下是了解插件如何工作的图表。

enter image description here

希望有所帮助