user1838222
user1838222

Reputation: 113

vb.net Webbrowser Control not displaying Javascript

I have tried this on numerous pc's and are receiving the same error. My webbrowser control isnt displaying javascript or jquery.

Here is a example:

when i visit this url in my browser: https://binarykings.co.uk/traderoom-aspx, it looks great with the charts and prices etc.

example: https://i.sstatic.net/AJ00K.jpg

same in internet explorer: https://i.sstatic.net/JMGSb.jpg

however in my vb.net webbrowser control it looks like this: https://i.sstatic.net/PbDEl.jpg

What is causing this ? Its not just this site but any other site that has a similar way of displaying things via jquery/javascript.

I do have script errors suppressed however when i disabled this and clicked yes to the errors manually it still displayed the same empty page.

Thanks

Upvotes: 0

Views: 7462

Answers (1)

Cody Gray
Cody Gray

Reputation: 244692

The WebBrowser control uses the Internet Explorer rendering engine. But by default, for compatibility reasons, it is stuck using the IE 7 rendering engine, even if you have a later version of the browser installed on your computer.

There are a couple of ways to convince it to use a newer version of IE to render the page. One involves editing the registry, while the other involves modifying the web page.

In general, it is best to avoid attempts to solve local problems with global solutions like registry edits. There might be another app running on the same machine that uses the WebBrowser control and relies on the behavior of the IE 7 rendering engine. If you go changing global settings, you'll mess up that other app.

Therefore, the best solution, if possible, is to edit the web page. This is quite simple, and probably a good idea anyway. All you need to do is add the following code inside of the <head> section:

<meta http-equiv="X-UA-Compatible" content="IE=9" >

If you absolutely must use the alternative approach of editing the registry, you'll find the information you need here in the documentation.

Upvotes: 5

Related Questions