如何使用IWebBrowser2修复应用程序中的javascript错误? [英] How to fix javascript error in application using IWebBrowser2?
问题描述
我有一个C ++应用程序,它使用IWebBrowser2接口呈现一些在线html页面. 问题是,当访问某个链接时,我会收到一个JavaScript错误,尽管如果我使用Internet Explorer访问同一页面,则该页面加载不会出现任何错误. 我的应用程序中收到的错误是对象不支持此操作"
I have a C++ aplication that is using the IWebBrowser2 interface for rendering some online html pages. The problem is that when accesing a certain link I receive a javascript error, although if I am accesing that same page using Internet Explorer, the page loads with no error. The recived error in my application is "Object doesn't support this action"
我能够通过使用put_Silent()方法并将其设置为VARIANT_TRUE来隐藏错误,但这不是解决方案,因为显示的内容不正确.
I was able to hide the error by using the put_Silent() method and setting it to VARIANT_TRUE, but this is not a solution as the content displayed is not correct.
我知道IWebBrowser2正在使用Internet Explorer引擎加载页面,所以我猜有一种方法可以解决此问题,因为该页面在IE中可以正常加载.
I know that IWebBrowser2 is using the Internet Explorer engine to load the pages, so I guess that there is a way to fix this problem as the page loads ok in IE.