我想在WebView中调用一个函数。我需要调用一些目标函数是这些:WebView InvokeScript HRESULT 0x80020101
play: function()
{
if (this.value < this.p.max)
{
this.inc();
this.timer = new it_timer({ object: this, method: "play", timeout: 200 });
}
else
this.stop();
},
stop: function()
{
if (this.timer)
this.timer.stop();
this.playing = false;
this.playbutton.style.backgroundPosition = "0 0";
}
我开始通过调用
webView.InvokeScript("play", new string[0]);
,但没有工作,HRESULT:0x80020101。我在这个话题上发现了这个http://support.microsoft.com/kb/247784,但它根本没有帮助我。
我又试图做什么,我发现作为一个多站点例如:
webView.InvokeScript("eval", new string[] { "document.documentElement.outerHTML;");
和
webView.InvokeScript("alert", new string[] {"message"});
,但这些都没有工作,在相同HRESULT代码。 WebView呈现正常,javascript在页面上正常工作。
我很感谢任何帮助确定问题/寻找解决方案。
编辑:它似乎“警惕”和所有在类中声明的方法不起作用。在早期的.NET版本中似乎有一个InvokeMethod(..),有没有WinRT的替代品?
我也想知道这一点,如果有人能够弄清楚这个问题或者向微软的某人回复这个问题,我会非常高兴。 – Akku 2012-06-14 13:08:46