I have seen this behavior as well. One thing is that the error handling
code is supposed to
return true;
to indicate that the error has been handled. I'm not sure what happens
if you don't.
On older versions of IE, like 5.0 and sometimes 5.5, there was a problem
with window.onerror if script debugging was not disabled. It seemed
that in that case, neither our custom error trapping code nor the
browser's default error message code was called, and the javascript
execution just quietly stopped.
On IE 6.0 the problem seems to have been fixed, though I can't find any
documentation on this. So currently our custom error trapping code only
runs if the browser is IE 6.0 and up.
-Roy
-----Original Message-----
From: SEAK, Teng-Fong [mailto:tfseak@f...]
Sent: Thursday, February 27, 2003 6:24 AM
To: javascript
Subject: [javascript] RE: Javascript errro handler
If you've just enabled that option, try to close the IE window,
verify that option again in "Internet options" and open a new window to
try
again.
Actually, the first time I enabled the option, I still have had the
window. But after some time, it didn't work anymore. I repeated the
experiment several times to come to that conclusion.
> -----Message d'origine-----
> De : Gerhard Wentink [mailto:gerhard@d...]
> Envoy=C3=A9 : jeudi 27 f=C3=A9vrier 2003 15:01
> =C3=80 : javascript
> Objet : [javascript] RE: Javascript errro handler
>
>
> I enabled script debugging, have Visual Studio installed and still the
> window is opened.
>
> Regards,
>
> Gerhard Wentink
>
> -----Oorspronkelijk bericht-----
> Van: SEAK, Teng-Fong [mailto:tfseak@f...]
> Verzonden: donderdag 27 februari 2003 14:19
> Aan: javascript
> Onderwerp: [javascript] RE: Javascript errro handler
>
>
> I've tested it in IE6 and NS7.01. In NS, the new window did
> appear. However, in IE, there's an option about script
> debugging. Go to
> Tools > Internet Options > Advanced (tag) > Disable script debugging.
>
> For me, when this option is not checked (ie script debugging is
> ENABLED), your error window can NOT be displayed. I'm not really sure
> why, but I think perhaps it has something to do with Visual
> Studio that
> I've installed. In fact, when there's error in a page (any page from
> the internet), I'll get a small dialog asking me if I want to debug !?
> And I suppose it is this thing which intercepts your onerror
> handler and
> thus short-circuits it.
>
> HTH
>
> > -----Message d'origine-----
> > De : Massimiliano Di Lorenzo [mailto:mdl@w...]
> > Envoy=C3=A9 : jeudi 27 f=C3=A9vrier 2003 10:55
> > =C3=80 : javascript
> > Objet : [javascript] Javascript errro handler
> >
> >
> > Someone can explain me why
> > this exaple not work fine???
> >
> > Tnx
> >
> >
> >
> > <html>
> > <head>
> > <title>Error test</title>
> > <script>
> > <!--
> > window.onerror =3D errWindow;
> > function errWindow(errMsg,location,lineNum) {
> > debugWin =3D window.open("","debugWin", "height=3D200,
> width=3D400, resize =3D
>
> > yes"); debugWin.document.write("<h2>There was an error at line " +
> > lineNum); debugWin.document.write("<br>The error was: " + errMsg);
> > debugWin.document.write("<br>The location was: " + location +
> > "</h2>");
> > debugWin.document.close();
> > }
> > -->
> > </script>
> > </head>
> > <body>
> > <h1>Error test</h1>
> > <a href=3D"javascript: createError();">Click to error</a> </body>
> > </html>
> >
>
>
>
>