Categories
Javascript

JavaScript onerror() method to handle error

The JavaScript onerror method is the first thing to handle error in JavaScript. This error event is called on the window object whenever any exception occurs on the page. There are three pieces of information to identify the exact error: Error message URL, in which file the error occurred The line number in the given […]

Categories
Javascript

How to associate functions with objects using JavaScript?

In JavaScript you can associate functions with objects. Here we will demonstrate how the constructor creates the object and assigns properties. Object is a standalone entity, with properties and type in JavaScript. JavaScript objects can have properties, that define their characteristics. Objects and properties: An object in JavaScript has properties associated with this. So, a […]