Answers

Question and Answer:

  Home  Expert JavaScript Developer

⟩ How can I set up my own JavaScript error handler?

To set up your own JavaScript error handler some optional parameters has to be known. These parameters are as follows:

- Textual description of error

- Address (URL) of page on which error occurred

- Number of line in which error occurred

If you want to invoke the default error handler of the browser, then your function should return (false) or vice versa. Example code:

function handlerFunction(description,page,line)

{ // put error-handling operators here

return true;}

window.onerror=handlerFunction;

 232 views

More Questions for you: