打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
To suppress the default Internet Explorer error message for the window onerror event
To suppress the default Internet Explorer error message for the window onerror event, you can set the returnValue property of the event object to True.

More information

To set the returnValue property to True, perform the following steps:
  1. Create a new Visual Basic standard EXE project. Form1 is created by default.
  2. Add a WebBrowser control to Form1.
  3. Add a Project Reference to the Microsoft HTML Object Library (Mshtml.tlb).
  4. In the declarations section of Form1, add the following code:
    Dim WithEvents objDoc As MSHTML.HTMLDocumentDim WithEvents objWind As MSHTML.HTMLWindow2Dim objEvent As CEventObj					
  5. In the WebBrowser1_NavigateComplete event, add the following code:
    Private Sub WebBrowser1_NavigateComplete()    Set objDoc = WebBrowser1.Document    Set objWind = objDoc.parentWindow    End Sub
  6. Add an event handler for the window onerror event as follows:
    Private Sub objWind_onerror(ByVal description As String, ByVal URL As String, ByVal line As Long)          Set objEvent = objWind.event    objEvent.returnValue = True    MsgBox (description)  End Sub
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
VC知识库:如何使IE在打开新窗口时,网页始终在本窗口中打开(也就是不另开新窗口)?
How To Cause Navigation to Occur in Same WebB...
BlogJava - jfy3d(剑事)BLOG - 关闭浏览器使session立即失效的方法
禁止鼠标右键or左右键和禁止f5刷新
禁止f5等快捷键的js代码
禁止网页复制的代码
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服