---
title: "vb的WebBrowser控件怎样避免浏览器脚本错误?"
author: "summerbell"
date: "2017-11-24T22:35:13Z"
tags: []
categories: ["编程语言"]
slug: "vb-webbrowser"
draft: false
lastmod: "2017-11-24T22:35:13Z"
id: 2400847
url: "https://summerbell.iteye.com/blog/2400847"
---

**解决方案1：**

窗体里加入下面代码即可：

 

Private Sub WebBrowser1\_DownloadBegin()

WebBrowser1.Silent = True

End Sub

Private Sub WebBrowser1\_DownloadComplete()

WebBrowser1.Silent = True

End Sub 

 

**解决方案2：**

 

选中“禁止脚本调试”复选框启动IE，选择“高级”选项卡，执行“工具→Internet选项”菜单