The method of the strict processing of JS event events
Foreign reference documents
Properties of the event constructor function:
Event.capturing_phase
The value of the constant event.capturing_phase is 1.
Event.at_target
The value of the constant Event.at_target is 2.
Event.bubbling_phase
The value of the constant event.bubbling_phase is 3.
Objects that implement the event interface:
Properties of objects that implement the event interface:
Type
This read-only is a string.
Target
This read-only is a object that implements the Eventtarget interface.
Currenttarget
This read-only is a object that implements the Eventtarget interface.
Eventphase
This read-only is a number.
Bubbles
This read-only is a Boolean.
Cancelable
This read-only is a Boolean.
Timestamp
This read-only is a object that implements the date interface.
NamespaceURI
This read-only is a string.
Functions of objects that implement the event interface:
Stoppropagation ()
This function has no return value.
Preventdefault ()
This function has no return value.
Initevent (Eventtypearg, Canbubblearg, Cancelablearg)
This function has no return value.
The Eventtypearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
Iscustom ()
This function returns a Boolean.
Stopimmediatepropagation ()
This function has no return value.
Isdefaultprevented ()
This function returns a Boolean.
Initeventns (Namespaceuriarg, Eventtypearg, Canbubblearg, Cancelablearg)
This function has no return value.
The Namespaceuriarg parameter is a string.
The Eventtypearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
Objects that implement the Eventtarget interface:
Functions of objects that implement the Eventtarget interface:
AddEventListener (type, listener, usecapture)
This function has no return value.
The type parameter is a string.
The listener parameter is a object that implements the EventListener interface.
The Usecapture parameter is a Boolean.
RemoveEventListener (type, listener, usecapture)
This function has no return value.
The type parameter is a string.
The listener parameter is a object that implements the EventListener interface.
The Usecapture parameter is a Boolean.
Dispatchevent (EVT)
This function returns a Boolean.
The EVT parameter is a object that implements the event interface.
This function can raise a implements the Eventexception interface.
Addeventlistenerns (NamespaceURI, type, listener, Usecapture, Evtgroup)
This function has no return value.
The NamespaceURI parameter is a string.
The type parameter is a string.
The listener parameter is a object that implements the EventListener interface.
The Usecapture parameter is a Boolean.
The Evtgroup parameter is a object that implements the object interface.
Removeeventlistenerns (NamespaceURI, type, listener, usecapture)
This function has no return value.
The NamespaceURI parameter is a string.
The type parameter is a string.
The listener parameter is a object that implements the EventListener interface.
The Usecapture parameter is a Boolean.
Willtriggerns (NamespaceURI, type)
This function returns a Boolean.
The NamespaceURI parameter is a string.
The type parameter is a string.
Haseventlistenerns (NamespaceURI, type)
This function returns a Boolean.
The NamespaceURI parameter is a string.
The type parameter is a string.
EventListener function:
This function has no return value. The parameter is a object that implements the event interface.
Properties of the Eventexception constructor function:
Eventexception.unspecified_event_type_err
The value of the constant Eventexception.unspecified_event_type_err is 0.
Eventexception.dispatch_request_err
The value of the constant Eventexception.dispatch_request_err is 1.
Objects that implement the Eventexception interface:
Properties of objects that implement the Eventexception interface:
Code
This is a number.
Objects that implement the Documentevent interface:
Functions of objects that implement the Documentevent interface:
CreateEvent (EventType)
This function returns a object that implements the event interface.
The EventType parameter is a string.
This function can raise a implements the Domexception interface.
Candispatch (NamespaceURI, type)
This function returns a Boolean.
The NamespaceURI parameter is a string.
The type parameter is a string.
Objects that implement the Customevent interface:
Objects that implement the Customevent interface have all properties and functions of the event interface as as the P roperties and functions defined below.
Functions of objects that implement the Customevent interface:
Setdispatchstate (target, phase)
This function has no return value.
The target parameter is a object that implements the Eventtarget interface.
The phase parameter is a number.
Ispropagationstopped ()
This function returns a Boolean.
Isimmediatepropagationstopped ()
This function returns a Boolean.
Objects that implement the Uievent interface:
Objects that implement the Uievent interface have all properties and functions of the event interface as the The Prope Rties and functions defined below.
Properties of objects that implement the Uievent interface:
View
This read-only is a object that implements the Abstractview interface.
Detail
This read-only is a number.
Functions of objects that implement the Uievent interface:
Inituievent (Typearg, Canbubblearg, Cancelablearg, Viewarg, Detailarg)
This function has no return value.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Detailarg parameter is a number.
Inituieventns (NamespaceURI, Typearg, Canbubblearg, Cancelablearg, Viewarg, Detailarg)
This function has no return value.
The NamespaceURI parameter is a string.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Detailarg parameter is a number.
Objects that implement the TextEvent interface:
Objects that implement the TextEvent interface have all properties and functions of the Uievent interface as as the P roperties and functions defined below.
Properties of objects that implement the TextEvent interface:
Data
This read-only is a string.
Functions of objects that implement the TextEvent interface:
Inittextevent (Typearg, Canbubblearg, Cancelablearg, Viewarg, Dataarg)
This function has no return value.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Dataarg parameter is a string.
Inittexteventns (NamespaceURI, type, Canbubblearg, Cancelablearg, Viewarg, Dataarg)
This function has no return value.
The NamespaceURI parameter is a string.
The type parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Dataarg parameter is a string.
Objects that implement the MouseEvent interface:
Objects that implement the MouseEvent interface have all properties and functions of the Uievent interface as the Properties and functions defined below.
Properties of objects that implement the MouseEvent interface:
Screenx
This read-only is a number.
Screeny
This read-only is a number.
Clientx
This read-only is a number.
Clienty
This read-only is a number.
Ctrlkey
This read-only is a Boolean.
Shiftkey
This read-only is a Boolean.
Altkey
This read-only is a Boolean.
Metakey
This read-only is a Boolean.
button
This read-only is a number.
Relatedtarget
This read-only is a object that implements the Eventtarget interface.
Altgraphkey
This read-only is a Boolean.
Functions of objects that implement the MouseEvent interface:
Initmouseevent (Typearg, Canbubblearg, Cancelablearg, Viewarg, Detailarg, Screenxarg, Screenyarg, Clientxarg, Clientyarg, Ctrlkeyarg, Altkeyarg, Shiftkeyarg, Metakeyarg, Buttonarg, Relatedtargetarg)
This function has no return value.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Detailarg parameter is a number.
The Screenxarg parameter is a number.
The Screenyarg parameter is a number.
The Clientxarg parameter is a number.
The Clientyarg parameter is a number.
The Ctrlkeyarg parameter is a Boolean.
The Altkeyarg parameter is a Boolean.
The Shiftkeyarg parameter is a Boolean.
The Metakeyarg parameter is a Boolean.
The Buttonarg parameter is a number.
The Relatedtargetarg parameter is a object that implements the Eventtarget interface.
Initmouseeventns (NamespaceURI, Typearg, Canbubblearg, Cancelablearg, Viewarg, Detailarg, Screenxarg, Screenyarg, Clientxarg, Clientyarg, Ctrlkeyarg, Altkeyarg, Shiftkeyarg, Metakeyarg, Buttonarg, Relatedtargetarg, Altgraphkeyarg)
This function has no return value.
The NamespaceURI parameter is a string.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Detailarg parameter is a number.
The Screenxarg parameter is a number.
The Screenyarg parameter is a number.
The Clientxarg parameter is a number.
The Clientyarg parameter is a number.
The Ctrlkeyarg parameter is a Boolean.
The Altkeyarg parameter is a Boolean.
The Shiftkeyarg parameter is a Boolean.
The Metakeyarg parameter is a Boolean.
The Buttonarg parameter is a number.
The Relatedtargetarg parameter is a object that implements the Eventtarget interface.
The Altgraphkeyarg parameter is a Boolean.
Properties of the KeyboardEvent constructor function:
Keyboardevent.dom_key_location_standard
The value of the constant Keyboardevent.dom_key_location_standard is 0x00.
Keyboardevent.dom_key_location_left
The value of the constant Keyboardevent.dom_key_location_left is 0x01.
Keyboardevent.dom_key_location_right
The value of the constant keyboardevent.dom_key_location_right is 0x02.
Keyboardevent.dom_key_location_numpad
The value of the constant Keyboardevent.dom_key_location_numpad is 0x03.
Keyboardevent.dom_key_location_unknown
The value of the constant Keyboardevent.dom_key_location_unknown is 0x04.
Objects that implement the KeyboardEvent interface:
Objects that implement the KeyboardEvent interface have all properties and functions of the Uievent interface as as a T He properties and functions defined below.
Properties of objects that implement the KeyboardEvent interface:
KeyIdentifier
This read-only is a string.
Keylocation
This read-only is a number.
Ctrlkey
This read-only is a Boolean.
Shiftkey
This read-only is a Boolean.
Altkey
This read-only is a Boolean.
Metakey
This read-only is a Boolean.
Altgraphkey
This read-only is a Boolean.
Functions of objects that implement the KeyboardEvent interface:
Initkeyboardevent (Typearg, Canbubblearg, Cancelablearg, Viewarg, Keyidentifierarg, Keylocationarg, Ctrlkeyarg, Shiftkeyarg, Altkeyarg, Metakeyarg, Altgraphkeyarg)
This function has no return value.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Keyidentifierarg parameter is a string.
The Keylocationarg parameter is a number.
The Ctrlkeyarg parameter is a Boolean.
The Shiftkeyarg parameter is a Boolean.
The Altkeyarg parameter is a Boolean.
The Metakeyarg parameter is a Boolean.
The Altgraphkeyarg parameter is a Boolean.
Initkeyboardeventns (NamespaceURI, type, Canbubblearg, Cancelablearg, Viewarg, Keyidentifierarg, Keylocationarg, Ctrlkeyarg, Shiftkeyarg, Altkeyarg, Metakeyarg, Altgraphkeyarg)
This function has no return value.
The NamespaceURI parameter is a string.
The type parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Viewarg parameter is a object that implements the Abstractview interface.
The Keyidentifierarg parameter is a string.
The Keylocationarg parameter is a number.
The Ctrlkeyarg parameter is a Boolean.
The Shiftkeyarg parameter is a Boolean.
The Altkeyarg parameter is a Boolean.
The Metakeyarg parameter is a Boolean.
The Altgraphkeyarg parameter is a Boolean.
Properties of the Mutationevent constructor function:
Mutationevent.modification
The value of the constant mutationevent.modification is 1.
Mutationevent.addition
The value of the constant mutationevent.addition is 2.
Mutationevent.removal
The value of the constant Mutationevent.removal is 3.
Objects that implement the Mutationevent interface:
Objects that implement the Mutationevent interface have all properties and functions of the event interface as as the Properties and functions defined below.
Properties of objects that implement the Mutationevent interface:
Relatednode
This read-only is a object that implements the node interface.
Prevvalue
This read-only is a string.
NewValue
This read-only is a string.
Attrname
This read-only is a string.
Attrchange
This read-only is a number.
Functions of objects that implement the Mutationevent interface:
Initmutationevent (Typearg, Canbubblearg, Cancelablearg, Relatednodearg, Prevvaluearg, Newvaluearg, Attrnamearg, ATTRCHANGEARG)
This function has no return value.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Relatednodearg parameter is a object that implements the node interface.
The Prevvaluearg parameter is a string.
The Newvaluearg parameter is a string.
The Attrnamearg parameter is a string.
The Attrchangearg parameter is a number.
Initmutationeventns (NamespaceURI, Typearg, Canbubblearg, Cancelablearg, Relatednodearg, Prevvaluearg, Newvaluearg, Attrnamearg, Attrchangearg)
This function has no return value.
The NamespaceURI parameter is a string.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Relatednodearg parameter is a object that implements the node interface.
The Prevvaluearg parameter is a string.
The Newvaluearg parameter is a string.
The Attrnamearg parameter is a string.
The Attrchangearg parameter is a number.
Objects that implement the Mutationnameevent interface:
Objects that implement the Mutationnameevent interface have all properties and functions of the Mutationevent interface as As the properties and functions defined below.
Properties of objects that implement the Mutationnameevent interface:
Prevnamespaceuri
This read-only is a string.
Prevnodename
This read-only is a string.
Functions of objects that implement the Mutationnameevent interface:
Initmutationnameevent (Typearg, Canbubblearg, Cancelablearg, Relatednodearg, Prevnamespaceuri, Prevnodename)
This function has no return value.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Relatednodearg parameter is a object that implements the node interface.
The Prevnamespaceuri parameter is a string.
The Prevnodename parameter is a string.
Initmutationnameeventns (NamespaceURI, Typearg, Canbubblearg, Cancelablearg, Relatednodearg, Prevnamespaceuri, Prevnodename)
This function has no return value.
The NamespaceURI parameter is a string.
The Typearg parameter is a string.
The Canbubblearg parameter is a Boolean.
The Cancelablearg parameter is a Boolean.
The Relatednodearg parameter is a object that implements the node interface.
The Prevnamespaceuri parameter is a string.
The Prevnodename parameter is a string.
function A (e) {
E.ABC = function () {
alert (a);
};
Prevevent = e;
Previeevent=window.event;
}
Function B (e,event) {
E.ABC (); Fn
Alert (E = = prevevent); True
if (event=window.event) {
alert (event===e); False
alert (event===previeevent);//false
alert (event===prevevent);//false
}
}
var t = document.getElementById ("P");
if (T.addeventlistener) {
T.addeventlistener (' Click ', A, false);
T.addeventlistener (' Click ', B, false)
} else {
T.attachevent (' onclick ', b);
T.attachevent (' onclick ', a)
}
: The attribute added to the event object in Fna, in the FNB function that is subsequently executed, is the event object accessible?
2: Is the event object when executing the FNA/FNB function congruent EVENTFNA===EVENTFNB?
The standard document is too long where is the rule here? Lazy Bar ...
For jquery, the event object between multiple execution functions is congruent.
In the implementation of the jquery live binding event, the function Livehandler that may be executed repeatedly relies on the Livefired property of the event object, which exits the function at the start of the Livehandler executed after the first time:
Copy code code as follows:
if (event.livefired = = This | | ...) {
Return
}
///....
event.livefired = this;