From d7904a9582702b6cef0a73ac147326278df5df18 Mon Sep 17 00:00:00 2001
From: Nick Schonning {{APIRef("Web Audio API")}} Note: You should typically call
- {{domxref("AudioContext.createGain()")}} to create a gain node. {{APIRef("Gamepad API")}} {{APIRef("Gamepad API")}} {{APIRef("Gamepad API")}} {{APIRef("Gamepad API")}} See also the extensions to the Gamepad interface, for features that allow you to access the above information. See also the extensions to the Gamepad interface, for features that allow you to access the above information. Chrome does things differently here. Instead of constantly storing the gamepad's latest state in a variable it only stores a snapshot, so to do the same thing in Chrome you have to keep polling it and then only use the {{ domxref("Gamepad") }} object in code when it is available. We have done this below using {{ domxref("Window.setInterval()") }}; once the object is available the gamepad info is outputted, the game loop is started, and the interval is cleared using {{ domxref("Window.clearInterval()") }}. Note that in older versions of Chrome {{ domxref("Navigator.getGamepads()") }} is implemented with a Chrome does things differently here. Instead of constantly storing the gamepad's latest state in a variable it only stores a snapshot, so to do the same thing in Chrome you have to keep polling it and then only use the {{ domxref("Gamepad") }} object in code when it is available. We have done this below using {{ domxref("WindowOrWorkerGlobalScope.setInterval") }}; once the object is available the gamepad info is outputted, the game loop is started, and the interval is cleared using {{ domxref("WindowOrWorkerGlobalScope.clearInterval") }}. Note that in older versions of Chrome {{ domxref("Navigator.getGamepads()") }} is implemented with a {{APIRef("Gamepad API")}} {{APIRef("Gamepad API")}} {{securecontext_header}}{{ APIref("Geolocation API") }} {{securecontext_header}}{{ APIref("Geolocation API") }}Browser compatibility
See also
diff --git a/files/en-us/web/api/gainnode/gainnode/index.html b/files/en-us/web/api/gainnode/gainnode/index.html
index d8601ea2863a210..6d80c804dae4666 100644
--- a/files/en-us/web/api/gainnode/gainnode/index.html
+++ b/files/en-us/web/api/gainnode/gainnode/index.html
@@ -2,13 +2,13 @@
title: GainNode()
slug: Web/API/GainNode/GainNode
tags:
-- API
-- Audio
-- Constructor
-- GainNode
-- Media
-- Reference
-- Web Audio API
+ - API
+ - Audio
+ - Constructor
+ - GainNode
+ - Media
+ - Reference
+ - Web Audio API
---
Syntax
diff --git a/files/en-us/web/api/gamepad/axes/index.html b/files/en-us/web/api/gamepad/axes/index.html
index 3be102a563a6698..25574c6d91ad298 100644
--- a/files/en-us/web/api/gamepad/axes/index.html
+++ b/files/en-us/web/api/gamepad/axes/index.html
@@ -2,14 +2,14 @@
title: Gamepad.axes
slug: Web/API/Gamepad/axes
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepad/buttons/index.html b/files/en-us/web/api/gamepad/buttons/index.html
index b83aa3dafba8884..05fc92b3e019c51 100644
--- a/files/en-us/web/api/gamepad/buttons/index.html
+++ b/files/en-us/web/api/gamepad/buttons/index.html
@@ -2,14 +2,14 @@
title: Gamepad.buttons
slug: Web/API/Gamepad/buttons
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepad/connected/index.html b/files/en-us/web/api/gamepad/connected/index.html
index 77568a271293b34..79c0712defc03af 100644
--- a/files/en-us/web/api/gamepad/connected/index.html
+++ b/files/en-us/web/api/gamepad/connected/index.html
@@ -2,14 +2,14 @@
title: Gamepad.connected
slug: Web/API/Gamepad/connected
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepad/id/index.html b/files/en-us/web/api/gamepad/id/index.html
index 8debd70426a38fe..6935017cd4a74f2 100644
--- a/files/en-us/web/api/gamepad/id/index.html
+++ b/files/en-us/web/api/gamepad/id/index.html
@@ -2,14 +2,14 @@
title: Gamepad.id
slug: Web/API/Gamepad/id
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepad/index.html b/files/en-us/web/api/gamepad/index.html
index 193c3a9c0516584..0e9862e891cc8d5 100644
--- a/files/en-us/web/api/gamepad/index.html
+++ b/files/en-us/web/api/gamepad/index.html
@@ -90,6 +90,6 @@ Browser compatibility
See also
diff --git a/files/en-us/web/api/gamepad/index/index.html b/files/en-us/web/api/gamepad/index/index.html
index 1ec55e3916df870..65f19f01eaf5170 100644
--- a/files/en-us/web/api/gamepad/index/index.html
+++ b/files/en-us/web/api/gamepad/index/index.html
@@ -2,14 +2,14 @@
title: Gamepad.index
slug: Web/API/Gamepad/index
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepad/mapping/index.html b/files/en-us/web/api/gamepad/mapping/index.html
index 4ab0de41623d8e0..9dfc88eafaf9750 100644
--- a/files/en-us/web/api/gamepad/mapping/index.html
+++ b/files/en-us/web/api/gamepad/mapping/index.html
@@ -2,14 +2,14 @@
title: Gamepad.mapping
slug: Web/API/Gamepad/mapping
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepad/timestamp/index.html b/files/en-us/web/api/gamepad/timestamp/index.html
index 0dad93b33b3090d..a20708f232f5efa 100644
--- a/files/en-us/web/api/gamepad/timestamp/index.html
+++ b/files/en-us/web/api/gamepad/timestamp/index.html
@@ -2,14 +2,14 @@
title: Gamepad.timestamp
slug: Web/API/Gamepad/timestamp
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepad_api/index.html b/files/en-us/web/api/gamepad_api/index.html
index 0fb7a21183728e1..0aed3a3e91b9e1b 100644
--- a/files/en-us/web/api/gamepad_api/index.html
+++ b/files/en-us/web/api/gamepad_api/index.html
@@ -32,7 +32,7 @@ Experimental Gamepad extensions
Extensions to other interfaces
diff --git a/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html b/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html
index bd723afbe4b5474..a6af2e7b4c5134c 100644
--- a/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html
+++ b/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html
@@ -130,7 +130,7 @@ Using button information
cancelRequestAnimationFrame(start);
});
-webkit
prefix. We attempt to detect and handle both the prefixed version and the standard version of the function for backwards compatibility.webkit
prefix. We attempt to detect and handle both the prefixed version and the standard version of the function for backwards compatibility.var interval;
diff --git a/files/en-us/web/api/gamepadbutton/index.html b/files/en-us/web/api/gamepadbutton/index.html
index 54a78305728e5e8..73bc06c8b17538b 100644
--- a/files/en-us/web/api/gamepadbutton/index.html
+++ b/files/en-us/web/api/gamepadbutton/index.html
@@ -89,4 +89,4 @@
diff --git a/files/en-us/web/api/gamepadbutton/value/index.html b/files/en-us/web/api/gamepadbutton/value/index.html
index 550de47275d4ca1..a35961ddaed199b 100644
--- a/files/en-us/web/api/gamepadbutton/value/index.html
+++ b/files/en-us/web/api/gamepadbutton/value/index.html
@@ -2,14 +2,14 @@
title: GamepadButton.value
slug: Web/API/GamepadButton/value
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepadbutton/pressed/index.html b/files/en-us/web/api/gamepadbutton/pressed/index.html
index ada70a90e2b40a7..4d10664a216ac3b 100644
--- a/files/en-us/web/api/gamepadbutton/pressed/index.html
+++ b/files/en-us/web/api/gamepadbutton/pressed/index.html
@@ -2,14 +2,14 @@
title: GamepadButton.pressed
slug: Web/API/GamepadButton/pressed
tags:
-- API
-- Gamepad API
-- Games
-- NeedsBetterSpecLink
-- NeedsMarkupWork
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Games
+ - NeedsBetterSpecLink
+ - NeedsMarkupWork
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepadevent/gamepad/index.html b/files/en-us/web/api/gamepadevent/gamepad/index.html
index cd9cbd2b2309a3f..8cb52546972d79a 100644
--- a/files/en-us/web/api/gamepadevent/gamepad/index.html
+++ b/files/en-us/web/api/gamepadevent/gamepad/index.html
@@ -2,11 +2,11 @@
title: GamepadEvent.gamepad
slug: Web/API/GamepadEvent/gamepad
tags:
-- API
-- Gamepad API
-- Property
-- Reference
-- Référence(2)
+ - API
+ - Gamepad API
+ - Property
+ - Reference
+ - Référence(2)
---
Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepadevent/index.html b/files/en-us/web/api/gamepadevent/index.html
index 139bf2e376d3f02..1902375ea73f69b 100644
--- a/files/en-us/web/api/gamepadevent/index.html
+++ b/files/en-us/web/api/gamepadevent/index.html
@@ -66,4 +66,4 @@ Browser compatibility
See also
-
+
diff --git a/files/en-us/web/api/gamepadpose/hasorientation/index.html b/files/en-us/web/api/gamepadpose/hasorientation/index.html
index f9b3034fff07a2d..a206a72a6e46c68 100644
--- a/files/en-us/web/api/gamepadpose/hasorientation/index.html
+++ b/files/en-us/web/api/gamepadpose/hasorientation/index.html
@@ -18,7 +18,7 @@
Syntax
-var hasItGotOrientation = gamepadPoseInstance.
+hasOrientation
;var hasItGotOrientation = gamepadPoseInstance.hasOrientation;
Value
diff --git a/files/en-us/web/api/gamepadpose/hasposition/index.html b/files/en-us/web/api/gamepadpose/hasposition/index.html
index 24a862eee21c251..073755df36bc413 100644
--- a/files/en-us/web/api/gamepadpose/hasposition/index.html
+++ b/files/en-us/web/api/gamepadpose/hasposition/index.html
@@ -18,7 +18,7 @@
Syntax
-var hasItGotPosition = gamepadPoseInstance.
+hasPosition
;var hasItGotPosition = gamepadPoseInstance.hasPosition;
Value
diff --git a/files/en-us/web/api/geolocation/clearwatch/index.html b/files/en-us/web/api/geolocation/clearwatch/index.html
index e87346df9aea1d9..cb339dc518e26a8 100644
--- a/files/en-us/web/api/geolocation/clearwatch/index.html
+++ b/files/en-us/web/api/geolocation/clearwatch/index.html
@@ -2,13 +2,13 @@
title: Geolocation.clearWatch()
slug: Web/API/Geolocation/clearWatch
tags:
-- API
-- Geolocation
-- Geolocation API
-- Method
-- NeedsExample
-- Reference
-- Secure context
+ - API
+ - Geolocation
+ - Geolocation API
+ - Method
+ - NeedsExample
+ - Reference
+ - Secure context
---
Browser compatibility
See also
-
Browser compatibility
See also
-
diff --git a/files/en-us/web/api/geolocationcoordinates/accuracy/index.html b/files/en-us/web/api/geolocationcoordinates/accuracy/index.html
index 8be2dc8e9be21aa..fcca09510bff329 100644
--- a/files/en-us/web/api/geolocationcoordinates/accuracy/index.html
+++ b/files/en-us/web/api/geolocationcoordinates/accuracy/index.html
@@ -2,12 +2,12 @@
title: GeolocationCoordinates.accuracy
slug: Web/API/GeolocationCoordinates/accuracy
tags:
-- API
-- Geolocation API
-- GeolocationCoordinates
-- Property
-- Secure context
-- accuracy
+ - API
+ - Geolocation API
+ - GeolocationCoordinates
+ - Property
+ - Secure context
+ - accuracy
---
Browser compatibility
See also
-
diff --git a/files/en-us/web/api/geolocationcoordinates/altitude/index.html b/files/en-us/web/api/geolocationcoordinates/altitude/index.html
index b54a7f50f221e46..7539ebf074a402f 100644
--- a/files/en-us/web/api/geolocationcoordinates/altitude/index.html
+++ b/files/en-us/web/api/geolocationcoordinates/altitude/index.html
@@ -2,12 +2,12 @@
title: GeolocationCoordinates.altitude
slug: Web/API/GeolocationCoordinates/altitude
tags:
-- API
-- Geolocation API
-- GeolocationCoordinates
-- Property
-- Secure context
-- altitude
+ - API
+ - Geolocation API
+ - GeolocationCoordinates
+ - Property
+ - Secure context
+ - altitude
---
Browser compatibility
See also
-
Browser compatibility
See also
-
diff --git a/files/en-us/web/api/geolocationcoordinates/heading/index.html b/files/en-us/web/api/geolocationcoordinates/heading/index.html
index d4d41e85f43e9f9..0929189ae23d109 100644
--- a/files/en-us/web/api/geolocationcoordinates/heading/index.html
+++ b/files/en-us/web/api/geolocationcoordinates/heading/index.html
@@ -2,12 +2,12 @@
title: GeolocationCoordinates.heading
slug: Web/API/GeolocationCoordinates/heading
tags:
-- API
-- Geolocation API
-- GeolocationCoordinates
-- Property
-- Secure context
-- heading
+ - API
+ - Geolocation API
+ - GeolocationCoordinates
+ - Property
+ - Secure context
+ - heading
---
90
degrees and west is 270
degrees). If {{domxref("GeolocationCoordinates.speed")}} is 0
,
heading
is
- NaN
. If
+ NaN
. If
the device is not able to provide heading information, this value is null
.
double
representing the accuracy of the altitude
expressed in meters. This value can be null
.double
representing the direction towards which the device is facing. This value, specified in degrees, indicates how far off from heading true north the device is. 0
degrees represents true north, and the direction is determined clockwise (which means that east is 90
degrees and west is 270
degrees). If speed
is 0
, heading
is NaN
. If the device is unable to provide heading
information, this value is null
.double
representing the direction towards which the device is facing. This value, specified in degrees, indicates how far off from heading true north the device is. 0
degrees represents true north, and the direction is determined clockwise (which means that east is 90
degrees and west is 270
degrees). If speed
is 0
, heading
is NaN
. If the device is unable to provide heading
information, this value is null
.double
representing the velocity of the device in meters per second. This value can be null
.From the GeolocationPosition
object, we obtain the user's latitude and
- longitude using {{domxref("Coordinates.latitude", "position.coords.latitude")}} and
+ longitude using {{domxref("GeolocationCoordinates/latitude", "position.coords.latitude")}} and
position.coords.longitude
so we can update the displayed coordinates. The
two {{HTMLElement("span")}} elements are updated to display the corresponding values
after being converted to a value with two decimal places.
The onemptied
property sets and returns the event handler for the
- emptied
event.
emptied
event.
load()
method is called to reload it.
-See the emptied
event
+
See the emptied
event
documentation for more information about the event.
Error events are fired at various targets for different kinds of errors:
error
event using interface {{domxref("ErrorEvent")}} is fired at {{domxref("window")}} and window.onerror()
is invoked (as well as handlers attached by {{domxref("window.addEventListener")}} (not only capturing)).error
event using interface {{domxref("Event")}} is fired at the element that initiated the load, and the onerror()
handler on the element is invoked. These error events do not bubble up to window, but can be handled with a {{domxref("window.addEventListener")}} configured with useCapture
set to true
.error
event using interface {{domxref("ErrorEvent")}} is fired at {{domxref("window")}} and window.onerror()
is invoked (as well as handlers attached by {{domxref("EventTarget.addEventListener")}} (not only capturing)).error
event using interface {{domxref("Event")}} is fired at the element that initiated the load, and the onerror()
handler on the element is invoked. These error events do not bubble up to window, but can be handled with a {{domxref("EventTarget.addEventListener")}} configured with useCapture
set to true
.Installing a global error
event handler is useful for automated collection of error reports.
For historical reasons, different arguments are passed to window.onerror
and element.onerror
handlers (as well as on error-type {{domxref("window.addEventListener")}} handlers).
For historical reasons, different arguments are passed to window.onerror
and element.onerror
handlers (as well as on error-type {{domxref("EventTarget.addEventListener")}} handlers).
message
: error message (string). Available as event
(sic!) in HTML onerror=""
handler.source
: URL of the script where the error was raised (string)lineno
: Line number where error was raised (number)colno
: Column number for the line where the error occurred (number) {{gecko_minversion_inline("31.0")}}error
: Error Object (object) {{gecko_minversion_inline("31.0")}}colno
: Column number for the line where the error occurred (number)error
: Error Object (object)When the function returns true
, this prevents the firing of the default event handler.
A good example for this is when you are using an image tag, and need to specify a backup image in case the one you need is not available on the server for any reason.
-<img src="imagenotfound.gif" onerror="this.onerror=null;this.src='imagefound.gif';" />
+<img src="imagenotfound.gif" onerror="this.onerror=null;this.src='imagefound.gif';" />The reason we have the
this.onerror=null
in the function is that the browser will be stuck in an endless loop if the onerror image itself generates an error.Notes
-When an error occurs in a script, loaded from a different origin, the details of the error are not reported to prevent leaking information (see {{bug("363897")}}). Instead the error reported is
+"Script error."
This behavior can be overridden in some browsers using the{{htmlattrxref("crossorigin","script")}}
attribute on {{HTMLElement("script")}} and having the server send the appropriate CORS HTTP response headers. A workaround is to isolate "Script error." and handle it knowing that the error detail is only viewable in the browser console and not accessible via JavaScript.When an error occurs in a script, loaded from a different origin, the details of the error are not reported to prevent leaking information (see {{bug("363897")}}). Instead the error reported is
"Script error."
This behavior can be overridden in some browsers using the{{htmlattrxref("crossorigin","script")}}
attribute on {{HTMLElement("script")}} and having the server send the appropriate CORS HTTP response headers. A workaround is to isolate "Script error." and handle it knowing that the error detail is only viewable in the browser console and not accessible via JavaScript.window.onerror = function (msg, url, lineNo, columnNo, error) { var string = msg.toLowerCase(); diff --git a/files/en-us/web/api/globaleventhandlers/onfocus/index.html b/files/en-us/web/api/globaleventhandlers/onfocus/index.html index aeb6c14e65f9ca9..378884621427597 100644 --- a/files/en-us/web/api/globaleventhandlers/onfocus/index.html +++ b/files/en-us/web/api/globaleventhandlers/onfocus/index.html @@ -2,12 +2,12 @@ title: GlobalEventHandlers.onfocus slug: Web/API/GlobalEventHandlers/onfocus tags: -- API -- Event Handler -- GlobalEventHandlers -- HTML DOM -- Property -- Reference + - API + - Event Handler + - GlobalEventHandlers + - HTML DOM + - Property + - Reference ---{{ApiRef("HTML DOM")}}@@ -19,7 +19,7 @@For
onfocus
to fire on non-input elements, they must be given the {{htmlattrxref("tabindex")}} attribute (see Building + href="/en-US/docs/Learn/Accessibility/HTML#building_keyboard_accessibility_back_in">Building keyboard accessibility back in for more details).diff --git a/files/en-us/web/api/globaleventhandlers/oninvalid/index.html b/files/en-us/web/api/globaleventhandlers/oninvalid/index.html index 28f3392ab97afb2..66cc18991695274 100644 --- a/files/en-us/web/api/globaleventhandlers/oninvalid/index.html +++ b/files/en-us/web/api/globaleventhandlers/oninvalid/index.html @@ -2,11 +2,11 @@ title: GlobalEventHandlers.oninvalid slug: Web/API/GlobalEventHandlers/oninvalid tags: -- API -- Event Handler -- GlobalEventHandlers -- Property -- Reference + - API + - Event Handler + - GlobalEventHandlers + - Property + - Reference ---{{ ApiRef("HTML DOM") }}@@ -17,7 +17,7 @@The
invalid
event fires when a submittable element has been checked and doesn't satisfy its constraints. The validity of submittable elements is checked before submitting their owner form, or after the -checkValidity()
+checkValidity()
method of the element or its owner form is called.Syntax
diff --git a/files/en-us/web/api/globaleventhandlers/onkeydown/index.html b/files/en-us/web/api/globaleventhandlers/onkeydown/index.html index 4b5a1e1d69037ab..ea69285e578cf2c 100644 --- a/files/en-us/web/api/globaleventhandlers/onkeydown/index.html +++ b/files/en-us/web/api/globaleventhandlers/onkeydown/index.html @@ -2,13 +2,13 @@ title: GlobalEventHandlers.onkeydown slug: Web/API/GlobalEventHandlers/onkeydown tags: -- API -- Event Handler -- GlobalEventHandlers -- HTML DOM -- Property -- Reference -- events + - API + - Event Handler + - GlobalEventHandlers + - HTML DOM + - Property + - Reference + - events ---{{ApiRef("HTML DOM")}}@@ -80,8 +80,8 @@Browser compatibility
Compatibility notes
-Since Firefox 65, the
keyup
and -keydown
events are now fired +Since Firefox 65, the
keyup
and +keydown
events are now fired during IME composition, to improve cross-browser compatibility for CJKT users ({{bug(354358)}}, also see keydown diff --git a/files/en-us/web/api/globaleventhandlers/onkeypress/index.html b/files/en-us/web/api/globaleventhandlers/onkeypress/index.html index faf9f0ac97c4f0e..e9b85695f187eea 100644 --- a/files/en-us/web/api/globaleventhandlers/onkeypress/index.html +++ b/files/en-us/web/api/globaleventhandlers/onkeypress/index.html @@ -2,12 +2,12 @@ title: GlobalEventHandlers.onkeypress slug: Web/API/GlobalEventHandlers/onkeypress tags: -- API -- Event Handler -- GlobalEventHandlers -- HTML DOM -- Property -- Reference + - API + - Event Handler + - GlobalEventHandlers + - HTML DOM + - Property + - Reference ---{{ApiRef("HTML DOM")}} {{deprecated_header}}@@ -162,7 +162,7 @@Browser compatibility notes
for the {{event("mousewheel")}} event.
- The
keypress
event is no longer fired for non-printable + href="/en-US/docs/Web/API/KeyboardEvent/keyCode#non-printable_keys_(function_keys)">non-printable keys (see {{bug(968056)}} for Firefox 65's implementation of this), except for the Enter key, and the Shift + Enter and Ctrl + Enter key combinations (these were kept for diff --git a/files/en-us/web/api/globaleventhandlers/onkeyup/index.html b/files/en-us/web/api/globaleventhandlers/onkeyup/index.html index cdf0c3616f0ee9f..e5dd29404a9568a 100644 --- a/files/en-us/web/api/globaleventhandlers/onkeyup/index.html +++ b/files/en-us/web/api/globaleventhandlers/onkeyup/index.html @@ -2,12 +2,12 @@ title: GlobalEventHandlers.onkeyup slug: Web/API/GlobalEventHandlers/onkeyup tags: -- API -- Event Handler -- GlobalEventHandlers -- HTML DOM -- Property -- Reference + - API + - Event Handler + - GlobalEventHandlers + - HTML DOM + - Property + - Reference ---{{ApiRef("HTML DOM")}}@@ -78,8 +78,8 @@Browser compatibility
Compatibility notes
-Since Firefox 65, the
keyup
and -keydown
events are now fired +Since Firefox 65, the
-keyup
and +keydown
events are now fired during IME composition, to improve cross-browser compatibility for CJKT users ({{bug(354358)}}, also see keydown @@ -88,12 +88,12 @@Compatibility notes
this (229 is a special value set for akeyCode
relating to an even that has been processed by an IME):+});eventTarget.addEventListener("keyup", event => { +
eventTarget.addEventListener("keyup", event => { if (event.isComposing || event.keyCode === 229) { return; } // do something -});See also
diff --git a/files/en-us/web/api/globaleventhandlers/onmousewheel/index.html b/files/en-us/web/api/globaleventhandlers/onmousewheel/index.html index 01a6651491a02f9..3cef25a6e701b15 100644 --- a/files/en-us/web/api/globaleventhandlers/onmousewheel/index.html +++ b/files/en-us/web/api/globaleventhandlers/onmousewheel/index.html @@ -5,7 +5,7 @@{{ ApiRef("HTML DOM") }} {{ Non-standard_header() }}
The onmousewheel property sets and returns the event handler for the + href="/en-US/docs/Web/Guide/Events/Event_handlers">event handler
diff --git a/files/en-us/web/api/globaleventhandlers/ontransitioncancel/index.html b/files/en-us/web/api/globaleventhandlers/ontransitioncancel/index.html index a80b9c77cee7f39..bd3cd58d6376769 100644 --- a/files/en-us/web/api/globaleventhandlers/ontransitioncancel/index.html +++ b/files/en-us/web/api/globaleventhandlers/ontransitioncancel/index.html @@ -2,14 +2,14 @@ title: GlobalEventHandlers.ontransitioncancel slug: Web/API/GlobalEventHandlers/ontransitioncancel tags: -- API -- CSS Transitions -- CSS3 Transitions -- Event Handler -- GlobalEventHandlers -- Property -- Reference -- ontransitioncancel + - API + - CSS Transitions + - CSS3 Transitions + - Event Handler + - GlobalEventHandlers + - Property + - Reference + - ontransitioncancel ---{{APIRef("CSS3 Transitions")}}@@ -110,12 +110,12 @@JavaScript
Next, we need to establish our event handlers to change the text content of the box when the transition begins and ends.
-let box = document.querySelector(".box"); +let box = document.querySelector(".box"); box.ontransitionrun = function(event) { - box.textContent = "Zooming..."; + box.textContent = "Zooming..."; } box.ontransitionend = function(event) { - box.textContent = "Done!"; + box.textContent = "Done!"; } box.onclick = function() { @@ -127,7 +127,7 @@JavaScript
} box.ontransitioncancel = function(event) { - console.log('transitioncancel fired after ' + event.elapsedTime + ' seconds.'
); + console.log('transitioncancel fired after ' + event.elapsedTime + ' seconds.'); }Result
diff --git a/files/en-us/web/api/gyroscope/index.html b/files/en-us/web/api/gyroscope/index.html index d312f47d5b939ee..e0c39c20af335c9 100644 --- a/files/en-us/web/api/gyroscope/index.html +++ b/files/en-us/web/api/gyroscope/index.html @@ -14,7 +14,7 @@ ---{{APIRef("Gyroscope")}}-The
+Gyroscope
interface of the Sensor APIs provides on each reading the angular velocity of the device along all three axes.The
Gyroscope
interface of the Sensor APIs provides on each reading the angular velocity of the device along all three axes.To use this sensor, the user must grant permission to the
'gyroscope'
device sensor through the {{domxref('Permissions')}} API.