Expert Developer JavaScript Question: Download Questions PDF
How can I set up my own JavaScript error handler?
![Expert JavaScript Developer Interview Answer Expert JavaScript Developer Interview Question](https://globalguideline.com/public/images/interview/22.png)
Answer:
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;
- 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;
Download Expert JavaScript Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain what is pop()method in JavaScript? | What is difference between undefined variable and undeclared variable? |