Home > Back-end >  JavaScript event summary.
JavaScript event summary.

Time:09-27

Event classification:

1, form events

The Form elements: submit, reset

Button form elements: click

Input, select box elements such as: change

Changing focus: focus, the blur, the two events will not bubble, focusin and focusout can bubble

Text input form: the input events in each time you change the text will trigger;

2, the window events

The occurrence of the event with the browser window itself, rather than the window display of any specific document content about

The Load event: triggered when fully loaded, DOMContentLoad and readystatechange is to replace the Load event; A single element can also be used, for example, img

Unload event: when the user leaves the current document, the special will trigger other documents, can't cancel the user state, plus beforeunloaded events, can ask the user whether to determine the chance of leaving the current page

Onerror attributes: when js error will trigger, but he is not a true event handlers, 14.6

Abort event: when the network resources for users to stop loading process and lead to failure will trigger him,

The Focus and the blur: when the browser window from your operating system or loses Focus will trigger

Resize: when the user to adjust the window size

Scroll: when the user Scroll, any overflow is set to wrap can trigger

3, the mouse events

Mouse events can be bubbling clientX and clientY attribute specifies the location of the mouse in the window coordinates, button and which attributes which is formulated the press the mouse button, when the ancillary pieces of press the keyboard, the corresponding property altkey ctrlkey, metakey, shiftkey will be set to true; For the click event detail attribute set actually click, double-click, or three strikes,

Mousemove: mobile, or drag the mouse

Mousedown, mouseup event: when the two events after join the queue time, will also triggers the click event

Click: dblckick

Mouseover and mouseout: hovering and out of events; For these two events have a relatedTarget attribute set of other elements involved in this process, the two events bubble, in order to prevent bubble, also provides two bubbling events mouseenter and mouseleave

Mousewheel (DOMmouseScroll) : the mouse wheel rolling, relay event object attribute specifies the size of the roller and the direction

4, keyboard events

Regardless of any element to trigger keyboard events, passed to the keyboard event handlers of the event object have keycode fields, which is designated press or release the key, and altkey ctrlkey, metakey, shiftkey

Keydown and keyup: between the two events will generate a keypress events, when press the key repeat produce character before the keyup may produce multiple keypress events, he points to the character is not to press the keys

5, DOM events:

To launch a new no bubbling events: focusin focusout, mouseenter, mouseleave

Mousewheel

(events, there is passed to the event object is no longer difficult to use digital keycode attributes, but by the specified input text string data property, specific events, nor is he a keyboard whether keyboard, cut, paste, etc. Any way can trigger, transfer object inputmethod attribute and a group representing the text input types of constant

Pass new keyboardEvent object as a parameter to keydown, keyup and keypress event handler to provide better support for text input events

Wheel in addition to the ordinary mouse events attributes and deltaX, deltaY and deltaZ attributes to report three different mouse roller,

6, HTML 5 events:

Audio and video elements

It's drag and drop API allows javascript application in a drag-and-drop operation based on the operating system to achieve data transmission between the web and native applications,

Dragstart drag dragend dragenter dragover dragleave drop

Its additional properties dataTransfer have a dataTransfer object, he contains about the transmission of data, and the format of the information available,

It defines the management mechanism, history hashchange and popstate,

It expressed a verification mechanism, including validation failure will trigger the invalid time,

HTML 5 support for offline web applications; Offline and online events, whenever the browser lose or get a network connection is the window object trigger them, the standard also defines a number of other time to notify the application download progress and application of the cache update

Message event, in every Message when the trigger;

It also defines some is not in the window, documentation and trigger events in the history of the object of the document element,

  • Related