您的位置:首页 > Web前端 > JavaScript

【C#WebBrowser 提示JS脚本错误】

2014-12-02 10:06 337 查看
问题:在IE浏览器可以正常显示的网页,用WebBrowser打开,弹出  脚本错误窗口。

问题分析:WebBrowser用的虽然是IE内核,但是WebBrowser默认的IE版本(好像是IE7)和计算机当前的IE浏览器的版本不相同。

解决办法1:修改注册表,

                    Win7  32位,注册表位置: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

                                         添加新项 "process.exe",(比如我的程序名是:process.exe), 右键,修改值, 选择“十进制” ,赋值 “9999”;

                    Win7  64位,注册表位置   HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet 

Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

                                         添加新项 "process.exe",(比如我的程序名是:process.exe), 右键,修改值, 选择“十进制” ,赋值 “9999”;

【注】:关于赋值“9999”, 英文原版(只看的懂IE9,所以试了一个9999,然后我的问题解决了):              

9999 (0x270F)

Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.

9000 (0x2328)

Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.

8888 (0x22B8)

Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.

8000 (0x1F40)

Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.

7000 (0x1B58)

Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: