1.在form 初始化时将webbrowser控件的ScriptErrorsSuppressed = True(false调试模式,允许脚本错误提示),也可以在其他合适的事件中设置。
2.写个子过程
Private
Sub
Window_Error(ByVal
sender As
Object, _ ByVal e
As
HtmlElementErrorEventArg
End
Sub
3.在webbrowser控件的browser_DocumentCompleted事件中调用上述子过程,代码如下:
(ByVal
sender As
Object, _
ByVal e
As
WebBrowserDocumentComple
End
Sub
注:browser为webbrowser控件名,比如webbrowser1之类的。