浏览器.文件InvokeScript()don';我不在IE9工作
本文关键字:工作 IE9 InvokeScript 文件 don 浏览器 | 更新日期: 2024-10-24 12:37:32
i尝试调用一个javascript函数,该函数的代码为
Webbrowser.Document.InvokeScript("something")
它在IE8中有效,但在IE9中无效。有人给我什么建议吗?
尝试像这个一样进行模拟
static private void UseIE9DocMode()
{
RegistryKey key = null;
try
{
key = Registry.CurrentUser.OpenSubKey("Software''Microsoft''Internet Explorer''Main''FeatureControl''FEATURE_BROWSER_EMULATION", true);
}
catch (Exception)
{
key = Registry.CurrentUser.CreateSubKey("Software''Microsoft''Internet Explorer''Main''FeatureControl''FEATURE_BROWSER_EMULATION");
}
key.SetValue(System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName, 9999, RegistryValueKind.DWord);
key.Close();
}
查看这些网址:http://deletethis.net/dave/?page=2&q=文档http://blogs.msdn.com/b/ie/archive/2009/03/10/more-ie8-extensibility-improvements.aspx
我通过向IE 9
的HEAD
标签添加以下代码解决了问题
<meta http-equiv="X-UA-Compatible" content="IE=9">