Jump to content

onerror


NoraL
 Share

Recommended Posts

I have the following code in my page:<script type="text/javascript">function handleError(message, URI, line) { window.location.replace("JavascriptError.htm?" + message + "," + URI + "," + line); return true;}window.onerror = handleError;</script>When my page encounters a syntax error, it fires the event fine. But when the page has what I consider to be a runtime error, it does not fire in IE 6. (It does seem to be firing in FireFox.)From all the documentation I have read, it says it should fire for all JavaScript errors. And I haven't found anyone else having this same problem.An example of an error that doesn't cause the event is as follows:Java Script ErrorDescription:A dynamic link library (DLL) initialization routine failed.And then the soure and line number are given.That's one example, but I can cause other JavaScript errors that aren't firing the code in IE 6.Is there something wrong in my code? Or has anyone else noticed this problem?Thanks,Nora

Link to comment
Share on other sites

umm... maybe this?

<script type="text/javascript">function handleError(URL, message, URI, line) {document.location.replace("JavascriptError.htm?" + message + "," + URI + "," + line);return true;}document.onerror = handleError;</script>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...