addEventListener
addEventListener(type, callback, options)
addEventListener(type
, callback
, options
?): void
Parameters
Parameter | Type |
---|---|
type | "keydown" |
callback | EventListenerOrEventListenerObject <KeyboardEvent > |
options ? | boolean | AddEventListenerOptions |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Element/keydown_event
addEventListener(type, callback, options)
addEventListener(type
, callback
, options
?): void
Parameters
Parameter | Type |
---|---|
type | "keyup" |
callback | EventListenerOrEventListenerObject <KeyboardEvent > |
options ? | boolean | AddEventListenerOptions |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Element/keyup_event
addEventListener(type, callback, options)
addEventListener(type
, callback
, options
?): void
The error
event is sent to the global scope when an unhandled error is thrown.
The default behavior when this event occurs is to print the error to the screen
using console.error()
, and no further application code
is executed. The user must then press the +
button to exit the application.
Call event.preventDefault()
to supress this default behavior.
Parameters
Parameter | Type |
---|---|
type | "error" |
callback | EventListenerOrEventListenerObject <ErrorEvent > |
options ? | boolean | AddEventListenerOptions |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Window/error_event
addEventListener(type, callback, options)
addEventListener(type
, callback
, options
?): void
The unhandledrejection
event is sent to the global scope when a JavaScript
Promise that has no rejection handler is rejected.
The default behavior when this event occurs is to print the error to the screen
using console.error()
, and no further application code
is executed. The user must then press the +
button to exit the application.
Call event.preventDefault()
to supress this default behavior.
Parameters
Parameter | Type |
---|---|
type | "unhandledrejection" |
callback | EventListenerOrEventListenerObject <PromiseRejectionEvent > |
options ? | boolean | AddEventListenerOptions |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event
addEventListener(type, callback, options)
addEventListener(type
, callback
, options
?): void
The beforeunload
event is fired when the +
button is pressed on the first controller.
This event gives the application a chance to prevent the default behavior of the application exiting. If the event is canceled, the application will not exit.
Parameters
Parameter | Type |
---|---|
type | "beforeunload" |
callback | (event ) => any |
options ? | boolean | AddEventListenerOptions |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Window/beforeunload_event
addEventListener(type, callback, options)
addEventListener(type
, callback
, options
?): void
The unload
event is fired when the application is exiting.
By the time this event occurs, the event loop has already been stopped, so no async operations may be scheduled in the event handler.
Parameters
Parameter | Type |
---|---|
type | "unload" |
callback | (event ) => any |
options ? | boolean | AddEventListenerOptions |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Window/unload_event
addEventListener(type, callback, options)
addEventListener(type
, callback
, options
?): void
Parameters
Parameter | Type |
---|---|
type | string |
callback | null | EventListenerOrEventListenerObject |
options ? | boolean | AddEventListenerOptions |
Returns
void