VB6 WebBrowser控件-JSON未定义错误 [英] VB6 WebBrowser Control - JSON undefine error

查看:346
本文介绍了VB6 WebBrowser控件-JSON未定义错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用VB6 WebBrowser控件浏览到一个网站并自动填写一个Web表单,但是每当我使它导航到一个网站时,它都会提示我一个JS错误-JSON未定义.任何人都可以帮助解决这个问题?

i want to use VB6 WebBrowser control to browse to a website and auto-fill a webform, but whenever i make it to navigate to a website, it will prompt me a JS error - JSON undefined. Anyone can help solve this issue?

我最初的猜测是VB6对于某些网站来说太老了",但我读到它实际上是使用我们在PC上安装的IE版本,而即时通讯使用的是带有Win7的最新IE10:-?

My initial guess is VB6 is 'too old' for some website, but i read that it is actually using the IE version we install on our pc and im using the latest IE10 with Win7 :-?

谢谢

推荐答案

该错误可能是由于网页希望浏览器引擎提供自己的JSON实现而引发的(几年前,它必须由页面实现本身,然后加上这一个)

The error is probably thrown because the web page expects the browser engine to provide its own JSON implementation (a few years ago, it had to be implemented by the page itself, and then along with checks like this one)

向WebBrowser控件抛出错误的原因是,它使用的引擎(默认情况下)已经冻结到IE7了(不提供JSON对象),而与实际安装的IE版本无关,仅仅是因为如果没有这样做,每次IE升级后,很多应用程序将无法正常运行/按预期运行.

The reason an error is thrown for the WebBrowser control is that the engine it uses (by default) has been frozen to IE7 a while ago (which didn't provide a JSON object), regardless of the actual IE version installed, simply because if it hadn't been done a lot of apps would cease to function properly/as intended after each upgrade of IE.

您可以在客户端计算机上设置(按用户或针对所有用户)定义在您的中使用时,WebBrowser控件应模拟哪个版本的IE.应用程序.

You can set on the client computer (per user or for all users) the IE feature control key "FEATURE_BROWSER_EMULATION" (MSDN link) to define which version of IE should be emulated by the WebBrowser control when used within your application.

有关此功能控制键的更多讨论(特别是警告,例如某些WebControl API在此过程中被破坏),您需要至少阅读以下两篇文章之一:

For more discussion on this feature control key (esp. caveats, like some WebControl APIs getting broken in the process), you'll want to read at least one of the following two articles:

  • http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version
  • http://www.cyotek.com/blog/configuring-the-emulation-mode-of-an-internet-explorer-webbrowser-control

这篇关于VB6 WebBrowser控件-JSON未定义错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆