Better error handling with window on error

Asked By 40 points N/A Posted on -

Hello friends,

When run the java script I ended up with an error message. I am a beginner and I am in the process of learning new concepts. I got this error message, having hard time. How do I find the solution? Please help me to resolve this error and to find solutions. Your help is great. Thanks a lot.

JavaScript error: Syntax error at line 1 while

loading: expected ‘)’. got <end of file> on line 1


Stop executing scripts on this page OK

Answered By 0 points N/A #188670

Better error handling with window on error


This is the output effect of the "window.onerror" fucntion. "onerror" is a DOM event handler that is initiated when an error occurs during the loading of objects.

The "window.onerror" function is also an event handler. It's job is to capture the errors when there is an uncaught exception or a compile-time error. "window.onerror" is then called to give contextual information about the error.

This is just a function to decrease difficulty in debugging your script. This basically shows the type of error or message, the line number where the error occured, and the url of the file.

Login/Register to Answer

Related Questions