I did that already but they still come up. I checked "Disable script debugging" and I unchecked "Display a notificatin about every script error" but they still show up.
Tony
Main Topics
Browse All TopicsHello,
Does anyone know how i can supress the "Internet Explorer Script Error" dialog?
I have an MFC DHTML dialog, but when I go some pages that have script errors a dialog popups up. I want to supress those dialogs.
Any help would be greatly appreciated.
Tony
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
here, http://msdn.microsoft.com/
it says
> (note that checking the Disable script debugging setting will apply only to that instance of Internet Explorer):
So that appears to be a per-instance setting. You would need to set it in your browser instance. It looks like you might need to add a window.onerror handler (I've never done that).
Aee if you can find this setting:
Automatically enable ASP server-side debugging on launch
in VS 7 and turn it off.
-- Dan
P.S. as ryancys said, it's best to just fix the errors :)
Go into regedit and Modify the Disable Script Debugger key to say "yes" without the quotes. It is located in a couple of locations.
One is for the current user and one for default profiles (Used when new users log on the the computer). If you already have user profiles already on the computer there are more entries in the HKEY_USERS\S-#-#-##\Softwa
HKEY_CURRENT_USER\Software
HKEY_USERS\.DEFAULT\Softwa
These should fix the problem.
I have searched the entire registry for "Disable Script Debugger" and changed everywhere to "yes" without the quotes and they still show up. I do not understand what it is about this script error dialog, but i cannot seem to get rid of them popping up... guess this is a hard one, maybe this should be worth 1000 points!!!!
Tony
Dan,
Someone I know at MS told me that the script error dialog will not get suppressed because it has a yes and no button that need user interaction. He said the only dialogs that get suppressed are error dialogs that are informational and have only one button. However, he could not confirm this to be true as of yet.
This sort of makes sense, what do you think? Can you confirm if this is true?
Thanks,
Tony
That is not true because all Script debugger messages ask if you want to debug them(yes) or not(no). They can be disabled. I have done it here at our business. Changing those registry values should have fixed it, as long as you don't have Visual Studio installed or some other related program that compiles scripts.
Frankly to say, you STILL need to solve the source where the error comes from.To deployed the application with buggy is NOT always the best choice. Your users will definitely come back to you if they seeing same problem as you're facing now. You may contact the script developer to resolve the problem.
regards
ryancys,
As I said before these are OTHER sites, this problem exists with standard IE, my app or netscape. The authors of the commercial sites have errors in their code. Like I said earlier it would be wonderful for ALL sites to be perfect, but it is out of the control of my app.
I am glad you are a purist and do not like to ship buggy code, but I do not wish to either. My code DOES NOT have a a bug, it is the sites we are going to. SO, to make my app nicer to users I was hoping I could find a way to disable the dialog.
I guess I have stumped alot of people and came across a problem that may not have a solution. Even the MS folks I have spoken with so far say to set the options, but it simply does not seem to work.
Thanks,
Tony
Dan,
You may have an answer to this one... I took part of a page that causes a script error, i can send it if you like. But in any event, I have an IE/HTML based app. If I open the html file in IE with the check boxes as talked about by all it does not display an error. BUT, in my app and the Microsoft, MFCIE Sample App, the script errors appear.
So, my conclusion is that the IE OCX does not abide by the internet options you can set in IE. Do you know how, or if, similiar options can be set in the MFCIE App, or my app.
Maybe this find will give some clues to all that have tried to answer, i guess this is really hard so I will up it 1000 points!!!! Seems like a thing to do, since this has been round and round for a bit!!
Plus I really appreciate the help in uncovering the mystery!!
Tony
About 1,000,000 other people seem to be having a similar problem!
Here is a google groups search...
http://groups.google.com/g
Here is what Microsoft has to say:
http://support.microsoft.c
The only people who offer a working solution describe how they had to change a registry setting (well, actually teo registry settings). Here is one solution that shows complete VB coding:
http://groups.google.com/g
At the bottom the poster briefly describes a different 'last resort' solution: He loads the HTML separately and feeds it into the browser. I suppose that would bypass the JIT (just in time) debugger's logic for (I'm guessing) installing an onerror handler.
Another thread gave me this idea:
Sink the "Download complete" event in your control. That will let you know if the popup occurs before or after that event. It might be possible to add a 'window.onerror' handler of your own at that point.
Post the URL of a page that causes the problem, and I'll take a stab at winning the 1000 points.
-- Dan
Dan, I do not have an url, but i do have a script line that produces a script error that i have used for testing... I have been looking at IHTMLWindow2 methods, they do have an onerror. I am not sure at this point how to get that event, but if you can help there, that may be a solution.
Search for DISPID_HTMLWINDOWEVENTS2_O
If you think that may work, help in how to implement it would be appreciated...
Thanks,
Tony
I guess then that you've seen this:
HOWTO: Handle Script Errors as a WebBrowser Control Host
http://support.microsoft.c
and the many links here:
http://support.microsoft.c
I have not re-installed VS7, so I can't experiemet with an MFC DHTML dialog right now. But I'll look into how that code provided in the first link above can be applied to your situation later tonight or tomorrow.
-- Dan
I am on this path now...
MSHTML::IHTMLDocument2Ptr pMainDoc= this->GetHtmlDocument();
_variant_t varFO = CFunctionObject<CMfcieView
MSHTML::IHTMLWindow2Ptr pWin;
pMainDoc->get_parentWindow
MSHTML::IHTMLWindow2Ptr pParentWin;
pWin->get_parent(&pParentW
HRESULT hr = pWin->put_onerror(varFO);
I will test it soon...
Dan,
You were going to look into a few things... let me tell you where i'm at... I have put this code in my OnDocumentComplete: MSHTML::IHTMLDocument2Ptr pDoc= GetMainWnd()->m_BrowserCon
if (pDoc)
{
_variant_t varFO = CFunctionObject<CIEHtmlVie
MSHTML::IHTMLWindow2Ptr pWin;
pDoc->get_parentWindow(&pW
MSHTML::IHTMLWindow2Ptr pParentWin;
pWin->get_parent(&pParentW
HRESULT hr = pWin->put_onerror(varFO);
}
AND, added the following function:
void CIEHtmlViewMain::OnErrorCa
{
TRACE("SCRIPT ERROR\n");
(*pVarResult).vt = VT_BOOL;
(*pVarResult).boolVal = VARIANT_TRUE;
}
But, it does not appear to ALWAYS get called. Any ideas why? I think I am on the something to catch these script errors, but it does not always seem to work.
Any help would be appreciated as this is a veri frustrating... and obviously, difficult problem!!
Thanks,
Tony
It looks like that should work... you are adding an onerror handler for the window. The fact that it works some of the time is very good news.
If I could see the source of a webpage in which it did *not* work, I could get some ideas. For instance, what if the page already has an onerror handler? Perhaps you need to first delete any existing onerror handler.
Another thing... some "pages" are really frames containing multiple pages. This technique might fail in that situation because you have not created an onerror handler for each page.
Another thing... A page can open an external window. This technique might fail in that situation because you have not created an onerror handler for each new popup window.
=-=-=-=-=-=-=-=-=
One final note:
You might be putting more into this than is needed. As far as I know, most users do *not* run with debugging enabled. The popup error message will only affect those who do web page debugging. And they won't mind it because they are used to it and expect the popups. That same group won't blame your program, but will know that the error is the fault of whoever designed the page they are browsing. Worth thinking about....
Until this weekend, when my Just-in-time Debugger window would pop up, if I already had an instance of Visual Studio .NET open, then that was the default. For some unknown reason, this Friday, that got changed to "New instance of Microsoft Script Debugger". I am able to change the default to "New instance of Visual Studio .NET" but I do not see how to change the default to use the existing VS.NET.
Does anyone have any ideas on how to get the default set to use the existing VS.NET instance?
Business Accounts
Answer for Membership
by: mikecurry74Posted on 2004-02-25 at 19:22:53ID: 10456785
Disable Script debugging in the advanced tab in Tools > Internet Options... as well as a few others (you'll see them)