Your code worked fine in my browser. I can't see anything wrong with what
you've written. It is correct to say "window.onerror = x" not
"window.onerror = x(1, 2, 3)" as you are merely registering the function
that will handle the error, it will take the three parameters that are
normally passed to the standard onerror anyway. If you are not seeing the
correct info or alerts, I would suggest that it is a browser problem.
I tried to do something similar at work recently on IE5 and it didn't work,
even though window.onerror is part of JavaScript 1.2. Didn't work at all.
Tried it at home and IE6 and it works beautifully. If you're running IE6,
then I have no idea why this is not working for you.
Peter.
"Robert Oschler" <no_replies@fake_email_address.invalid> wrote in message
news:WynSa.605$gi.763359@news2.news.adelphia.net.. .[color=blue]
> If I set window.onerror to an error handler I've created, I don't see the
> browser error dialogs anymore but I don't see the alert() messages in my
> error handler pop up either. Can someone tell me what I am doing wrong?
> Here's the test doc I'm using:
>
> =========== BEGIN TEST DOC ===================
>
> <HTML>
> <TITLE> OnError Test </TITLE>
> <HEAD>
>
> <script>
> window.onerror=x;
>
> function x(a, b, c)
> {
> alert("hello");
> alert(a + b + c);
> return true;
> }
> </script>
>
> </HEAD>
> <BODY>
> <script>
> bbb(); // Function doesn't exist so it triggers error.
> </script>
> </BODY>
> </HTML>
>
> ========== END TEST DOC ==========
>
> --
>
> Robert Oschler
> "Let the web hear you, add your voice to your web site in minutes!"
> --
http://audiodirect.spiderchase.com/
> (For a limited time, free voiceover with every sign-up, use this link
> instead)
> --
http://audio.spiderchase.com/
> (A song - are you blue?)
> --
http://bluedreams.spiderchase.com/
>
>[/color]