JavaScript window onerror event

kudvenkat
Youtube
Related Topic
:- Javascript Web Development

In general we use try/catch statement to catch errors in JavaScript. If an error is raised by a statement that is not inside a try...catch block, the onerror event is fired. Assign a function to window.onerror event that you want to be executed when an error is raised as shown below. The function that is associated as the event handler for the onerror event has three parameters: message Specifies the error message. 

Comments