Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

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 :-?

Thank you,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
140 views
Welcome To Ask or Share your Answers For Others

1 Answer

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)

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.

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.

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:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...