Event-driven in the web front-end refers to the interaction between two objects, driving one of the two objects to make corresponding behaviors or actions; event-driven refers to the process of continuous transaction management, A strategy for making decisions, that is, following events that occur at the current point in time, mobilizing available resources, and performing related tasks to solve emerging problems and prevent the accumulation of matters.
The operating environment of this tutorial: Windows 10 system, JavaScript version 1.8.5, Dell G3 computer.
Event-driven refers to a strategy for decision-making in the process of continuous transaction management, that is, following events that occur at the current point in time and mobilizing available resources , perform related tasks so that recurring problems can be solved and prevent matters from piling up. It has applications in computer programming, public relations, economic activities and other fields.
What is an event? An event is an interaction between two objects, which can become an event.
The event-driven is the interactive behavior between two objects, driving one of the two objects to make the corresponding behavior or action,
Li Si and Zhang San shook hands, which created an interaction, also called an event. Zhang San's behavior of holding Li Si's hand made Li Si very happy and even danced. This is event-driven.
The so-called event-driven simply means what button you click (that is, what event is generated) and what operation the computer performs (that is, what function is called). Of course, events are not limited to user operations. The core of event-driven is naturally event. From an event perspective, the basic structure of an event-driven program is composed of an event collector, an event transmitter and an event processor. The event collector is specifically responsible for collecting all events, including those from the user (such as mouse, keyboard events, etc.), from hardware (such as clock events, etc.) and from software (such as the operating system, the application itself, etc.). The event emitter is responsible for distributing events collected by the collector to target objects. The event handler does specific event response work, which is often not completely determined until the implementation stage, so the virtual function mechanism needs to be used (the function name is often taken as a name similar to HandleMsg). For users of the framework, what they can see are event handlers. This is what they care about.
Expand knowledge
Event-driven in javaScript
Event-driven in javascript is through The main events triggered by mouse or hotkey actions are as follows:
Mouse click event onclick such as: ()
Usually used for the following controls:
button button object
checkbox check box or check list - - Cooperate with onclick click event, usually used for all-select effect
radio radio button
reset reset button
submit button
Content change event onchange such as: ()
Get focus event onFocus --Occurs when the object gets focus
lost Focus event onBlur --corresponds to the focus event!
#Document loading event onload --The event is triggered when the document is loaded. It is also usually called a loading event (loading run). It is generally used to set cookies
#Unload document event onunload --corresponds to the load document event. Occurs when the web page exits, usually updating the cookie value
Right mouse button menu function event oncontextmenu --Used when the right mouse button can be blocked
【Related recommendations:
javascript video tutorial
The above is the detailed content of What is event-driven in web front-end. For more information, please follow other related articles on the PHP Chinese website!