What is the main difference between Handler and Event?

advertisements

I am not understanding the difference between Handler and Event. Please tell me the use of that two things and when to use the handler when to use the Event.


Event:- In computing, an event is an action or occurrence detected by the program that may be handled by the program. Typically events are handled synchronously with the program flow, that is, the program has one or more dedicated places where events are handled.

EventHandler:-

A function or method containing program statements that are executed in response to an event. An event handler typically is a software routine that processes actions such as keystrokes and mouse movements. With Web sites, event handlers make Web content dynamic. JavaScript is a common method of scripting event handlers for Web content.

Very basic example is you click on login button on facebook, there is corresponding event handler for click on login button which tells facebook app that user trying to login