Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to disable 'Script Error' prompt when openning a page with script errors

1 view
Skip to first unread message

Fei Yuan

unread,
Jul 27, 2005, 5:23:28 PM7/27/05
to
Hi, I embedded webbrowser within my application acting as an HTML viewer.
However, when an HTML page contains invalid scripts (mostly 'copy-paste'
operation off a website), the viewer throws several 'Internet Explorer
Script Error' prompt pages, and ask user to click 'Yes', or 'No' in order to
continue.

This behavior is highly undesirable since I can see that Outlook never
displays an error message with the same HTML page, nor does Internet
Explorer, which only shows a small warning icon and details on the bottom
left corner instead of an annoying popup message.

Does someone know how do I achieve same effect with the webbrowser OCX
control?

Thanks!


Igor Tandetnik

unread,
Aug 2, 2005, 9:48:23 PM8/2/05
to
"Fei Yuan" <f...@carmelvision.com> wrote in message
news:%23t%23ouFvk...@TK2MSFTNGP14.phx.gbl

> Hi, I embedded webbrowser within my application acting as an HTML
> viewer. However, when an HTML page contains invalid scripts (mostly
> 'copy-paste' operation off a website), the viewer throws several
> 'Internet Explorer Script Error' prompt pages, and ask user to click
> 'Yes', or 'No' in order to continue.

The easiest way is to set Silent property to true. That would just
suppress those prompts. If you want to be smarter and actually get the
text and code of the error, line number and so on, see KB Article
KB261003 "How to handle script errors as a WebBrowser control host"
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


0 new messages