From fdc77da2ba02ff78b23fc129ec7ee20c0fa28afb Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 9 Sep 2021 00:49:39 +0000 Subject: [CRON] sync translated content --- files/es/_redirects.txt | 3 +- files/es/_wikihistory.json | 16 ++-- files/es/web/api/keyboardevent/which/index.html | 62 ------------- files/es/web/api/uievent/which/index.html | 63 +++++++++++++ files/fr/_redirects.txt | 1 + files/fr/_wikihistory.json | 21 +---- files/fr/web/api/bytestring/index.html | 38 -------- .../reference/global_objects/string/index.html | 39 ++++++++ files/ja/_redirects.txt | 2 + files/ja/_wikihistory.json | 24 ++--- .../reference/global_objects/string/index.html | 44 +++++++++ files/ja/web/api/bytestring/index.html | 43 --------- files/ja/web/api/mouseevent/which/index.html | 52 ----------- files/ja/web/api/uievent/which/index.html | 53 +++++++++++ files/ru/_redirects.txt | 3 + files/ru/_wikihistory.json | 41 +++------ .../conflicting/web/api/uievent/which/index.html | 48 ++++++++++ .../reference/global_objects/string/index.html | 35 +++++++ files/ru/web/api/bytestring/index.html | 34 ------- files/ru/web/api/keyboardevent/which/index.html | 97 -------------------- files/ru/web/api/mouseevent/which/index.html | 47 ---------- files/ru/web/api/uievent/which/index.html | 98 ++++++++++++++++++++ files/zh-cn/_redirects.txt | 3 + files/zh-cn/_wikihistory.json | 50 +++------- .../conflicting/web/api/uievent/which/index.html | 100 ++++++++++++++++++++ .../reference/global_objects/string/index.html | 41 +++++++++ files/zh-cn/web/api/bytestring/index.html | 40 -------- files/zh-cn/web/api/keyboardevent/which/index.html | 101 -------------------- files/zh-cn/web/api/mouseevent/which/index.html | 99 -------------------- files/zh-cn/web/api/uievent/which/index.html | 102 +++++++++++++++++++++ 30 files changed, 687 insertions(+), 713 deletions(-) delete mode 100644 files/es/web/api/keyboardevent/which/index.html create mode 100644 files/es/web/api/uievent/which/index.html delete mode 100644 files/fr/web/api/bytestring/index.html create mode 100644 files/fr/web/javascript/reference/global_objects/string/index.html create mode 100644 files/ja/conflicting/web/javascript/reference/global_objects/string/index.html delete mode 100644 files/ja/web/api/bytestring/index.html delete mode 100644 files/ja/web/api/mouseevent/which/index.html create mode 100644 files/ja/web/api/uievent/which/index.html create mode 100644 files/ru/conflicting/web/api/uievent/which/index.html create mode 100644 files/ru/conflicting/web/javascript/reference/global_objects/string/index.html delete mode 100644 files/ru/web/api/bytestring/index.html delete mode 100644 files/ru/web/api/keyboardevent/which/index.html delete mode 100644 files/ru/web/api/mouseevent/which/index.html create mode 100644 files/ru/web/api/uievent/which/index.html create mode 100644 files/zh-cn/conflicting/web/api/uievent/which/index.html create mode 100644 files/zh-cn/conflicting/web/javascript/reference/global_objects/string/index.html delete mode 100644 files/zh-cn/web/api/bytestring/index.html delete mode 100644 files/zh-cn/web/api/keyboardevent/which/index.html delete mode 100644 files/zh-cn/web/api/mouseevent/which/index.html create mode 100644 files/zh-cn/web/api/uievent/which/index.html (limited to 'files') diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index a9ca29c7e8..f6c93836da 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -1546,6 +1546,7 @@ /es/docs/Web/API/HTMLOrForeignElement/focus /es/docs/orphaned/Web/API/HTMLOrForeignElement/focus /es/docs/Web/API/IDBObjectStore.add /es/docs/Web/API/IDBObjectStore/add /es/docs/Web/API/IndexedDB_API/Usando_IndexedDB /es/docs/Web/API/IndexedDB_API/Using_IndexedDB +/es/docs/Web/API/KeyboardEvent/which /es/docs/Web/API/UIEvent/which /es/docs/Web/API/Navigator.getUserMedia /es/docs/Web/API/Navigator/getUserMedia /es/docs/Web/API/NavigatorConcurrentHardware /es/docs/orphaned/Web/API/NavigatorConcurrentHardware /es/docs/Web/API/NavigatorConcurrentHardware/hardwareConcurrency /es/docs/orphaned/Web/API/NavigatorConcurrentHardware/hardwareConcurrency @@ -1596,7 +1597,7 @@ /es/docs/Web/API/WindowTimers/setTimeout /es/docs/Web/API/setTimeout /es/docs/Web/API/XMLHttpRequest/FormData /es/docs/Web/API/FormData /es/docs/Web/API/event.defaultPrevented /es/docs/Web/API/Event/defaultPrevented -/es/docs/Web/API/event.which /es/docs/Web/API/KeyboardEvent/which +/es/docs/Web/API/event.which /es/docs/Web/API/UIEvent/which /es/docs/Web/Accesibilidad /es/docs/Web/Accessibility /es/docs/Web/Accesibilidad/Comunidad /es/docs/Web/Accessibility/Community /es/docs/Web/Accesibilidad/Understanding_WCAG /es/docs/Web/Accessibility/Understanding_WCAG diff --git a/files/es/_wikihistory.json b/files/es/_wikihistory.json index fd2d790297..070b6132b6 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -7446,14 +7446,6 @@ "empirreamm" ] }, - "Web/API/KeyboardEvent/which": { - "modified": "2019-03-23T23:25:30.040Z", - "contributors": [ - "fscholz", - "jsx", - "arthusu" - ] - }, "Web/API/Location": { "modified": "2020-03-11T08:46:40.807Z", "contributors": [ @@ -8440,6 +8432,14 @@ "fscholz" ] }, + "Web/API/UIEvent/which": { + "modified": "2019-03-23T23:25:30.040Z", + "contributors": [ + "fscholz", + "jsx", + "arthusu" + ] + }, "Web/API/URL": { "modified": "2019-03-23T22:19:12.735Z", "contributors": [ diff --git a/files/es/web/api/keyboardevent/which/index.html b/files/es/web/api/keyboardevent/which/index.html deleted file mode 100644 index 11e1e3e48e..0000000000 --- a/files/es/web/api/keyboardevent/which/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: event.which -slug: Web/API/KeyboardEvent/which -tags: - - DOM - - events - - metodo - - which -translation_of: Web/API/KeyboardEvent/which ---- -

{{ ApiRef() }}

-

Resumen

-

Devuelve el keyCode de la tecla presionada, o el codigo del caracter (charCode) de la tecla alfanumerica presionada.

-

Sintaxis

-
var keyResult = event.which;
-
-

keyResult contiene el codigo numerico para una tecla en particular, dependiendo si la tecla presionada es alfanumerica o no-alfanumerica. Por favor mire charCode y keyCode para mas informacion.

-

Ejemplo

-
<html>
-<head>
-<title>charCode/keyCode/which example</title>
-
-<script type="text/javascript">
-
-function showKeyPress(evt)
-{
-alert("onkeypress handler: \n"
-      + "keyCode property: " + evt.keyCode + "\n"
-      + "which property: " + evt.which + "\n"
-      + "charCode property: " + evt.charCode + "\n"
-      + "Character Key Pressed: "
-      + String.fromCharCode(evt.charCode) + "\n"
-     );
-}
-
-
-function keyDown(evt)
-{
-alert("onkeydown handler: \n"
-      + "keyCode property: " + evt.keyCode + "\n"
-      + "which property: " + evt.which + "\n"
-     );
-}
-
-
-</script>
-</head>
-
-<body
- onkeypress="showKeyPress(event);"
- onkeydown="keyDown(event);"
->
-
-<p>Por favor presione cualquier tecla.</p>
-
-</body>
-</html>
-
-
- Nota: El codigo de arriba falla en Firefox 9 debido al bug 696020.
-

Especificacion

-

No es parte de ninguna especificacion.

diff --git a/files/es/web/api/uievent/which/index.html b/files/es/web/api/uievent/which/index.html new file mode 100644 index 0000000000..e86c4363e1 --- /dev/null +++ b/files/es/web/api/uievent/which/index.html @@ -0,0 +1,63 @@ +--- +title: event.which +slug: Web/API/UIEvent/which +tags: + - DOM + - events + - metodo + - which +translation_of: Web/API/KeyboardEvent/which +original_slug: Web/API/KeyboardEvent/which +--- +

{{ ApiRef() }}

+

Resumen

+

Devuelve el keyCode de la tecla presionada, o el codigo del caracter (charCode) de la tecla alfanumerica presionada.

+

Sintaxis

+
var keyResult = event.which;
+
+

keyResult contiene el codigo numerico para una tecla en particular, dependiendo si la tecla presionada es alfanumerica o no-alfanumerica. Por favor mire charCode y keyCode para mas informacion.

+

Ejemplo

+
<html>
+<head>
+<title>charCode/keyCode/which example</title>
+
+<script type="text/javascript">
+
+function showKeyPress(evt)
+{
+alert("onkeypress handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+      + "charCode property: " + evt.charCode + "\n"
+      + "Character Key Pressed: "
+      + String.fromCharCode(evt.charCode) + "\n"
+     );
+}
+
+
+function keyDown(evt)
+{
+alert("onkeydown handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+     );
+}
+
+
+</script>
+</head>
+
+<body
+ onkeypress="showKeyPress(event);"
+ onkeydown="keyDown(event);"
+>
+
+<p>Por favor presione cualquier tecla.</p>
+
+</body>
+</html>
+
+
+ Nota: El codigo de arriba falla en Firefox 9 debido al bug 696020.
+

Especificacion

+

No es parte de ninguna especificacion.

diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 9cd2fc2d36..c0500acf6e 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -3467,6 +3467,7 @@ /fr/docs/Web/API/AudioContext/createGain /fr/docs/Web/API/BaseAudioContext/createGain /fr/docs/Web/API/Body /fr/docs/orphaned/Web/API/Body /fr/docs/Web/API/Body/json /fr/docs/orphaned/Web/API/Body/json +/fr/docs/Web/API/ByteString /fr/docs/Web/JavaScript/Reference/Global_Objects/String /fr/docs/Web/API/CSSMatrix /fr/docs/Web/API/DOMMatrix /fr/docs/Web/API/Canvas_API/Tutoriel_canvas /fr/docs/Web/API/Canvas_API/Tutorial /fr/docs/Web/API/Canvas_API/Tutoriel_canvas/Advanced_animations /fr/docs/Web/API/Canvas_API/Tutorial/Advanced_animations diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index fcdcc1acd9..0d9b5c1352 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -12013,14 +12013,6 @@ "loella16" ] }, - "Web/API/ByteString": { - "modified": "2019-03-23T22:50:30.417Z", - "contributors": [ - "BEHOUBA", - "SphinxKnight", - "Hell_Carlito" - ] - }, "Web/API/CDATASection": { "modified": "2020-10-15T21:37:54.310Z", "contributors": [ @@ -38297,18 +38289,11 @@ ] }, "Web/JavaScript/Reference/Global_Objects/String": { - "modified": "2020-10-15T21:09:29.467Z", + "modified": "2019-03-23T22:50:30.417Z", "contributors": [ + "BEHOUBA", "SphinxKnight", - "Brack0", - "grandoc", - "LCaba49", - "gabrielvv", - "tregagnon", - "teoli", - "fscholz", - "daniel35310", - "rat" + "Hell_Carlito" ] }, "Web/JavaScript/Reference/Global_Objects/String/@@iterator": { diff --git a/files/fr/web/api/bytestring/index.html b/files/fr/web/api/bytestring/index.html deleted file mode 100644 index 48cb5b812d..0000000000 --- a/files/fr/web/api/bytestring/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: ByteString -slug: Web/API/ByteString -tags: - - API - - DOM - - Reference - - WebIDL -translation_of: Web/API/ByteString ---- -
{{APIRef("DOM")}}
- -

ByteString est une chaîne de caractères en UTF-8 qui contient l'ensemble des séquences d'octets possibles. ByteString correspond à une chaîne de caractères (type {{jsxref("String")}}) lorsqu'il est manipulé en JavaScript. En général, cet objet est uniquement utilisé dans l'interfaçage de protocoles qui utilisent les octets et les chaînes de façon interchangeable (HTTP par exemple).

- -

Spécifications

- - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}Définition initiale.
- -

Voir aussi

- - diff --git a/files/fr/web/javascript/reference/global_objects/string/index.html b/files/fr/web/javascript/reference/global_objects/string/index.html new file mode 100644 index 0000000000..808d99008b --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/string/index.html @@ -0,0 +1,39 @@ +--- +title: ByteString +slug: Web/JavaScript/Reference/Global_Objects/String +tags: + - API + - DOM + - Reference + - WebIDL +translation_of: Web/API/ByteString +original_slug: Web/API/ByteString +--- +
{{APIRef("DOM")}}
+ +

ByteString est une chaîne de caractères en UTF-8 qui contient l'ensemble des séquences d'octets possibles. ByteString correspond à une chaîne de caractères (type {{jsxref("String")}}) lorsqu'il est manipulé en JavaScript. En général, cet objet est uniquement utilisé dans l'interfaçage de protocoles qui utilisent les octets et les chaînes de façon interchangeable (HTTP par exemple).

+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}Définition initiale.
+ +

Voir aussi

+ + diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index 8014f04141..8fd044c2be 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -3045,6 +3045,7 @@ /ja/docs/Web/API/AudioContext/sampleRate /ja/docs/Web/API/BaseAudioContext/sampleRate /ja/docs/Web/API/AudioContext/state /ja/docs/Web/API/BaseAudioContext/state /ja/docs/Web/API/Boolean /ja/docs/Web/JavaScript/Reference/Global_Objects/Boolean +/ja/docs/Web/API/ByteString /ja/docs/conflicting/Web/JavaScript/Reference/Global_Objects/String /ja/docs/Web/API/CSSMatrix /ja/docs/Web/API/DOMMatrix /ja/docs/Web/API/CSSStyleSheet.insertRule /ja/docs/Web/API/CSSStyleSheet/insertRule /ja/docs/Web/API/CSS_Painting_API/ガイド /ja/docs/Web/API/CSS_Painting_API/Guide @@ -3161,6 +3162,7 @@ /ja/docs/Web/API/Index /ja/docs/conflicting/Web/API_49b9a84475f11fffb8fc271a7df3c49a /ja/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB /ja/docs/Web/API/IndexedDB_API/Basic_Terminology /ja/docs/Web/API/MediaRecorder_API /ja/docs/Web/API/MediaStream_Recording_API +/ja/docs/Web/API/MouseEvent/which /ja/docs/Web/API/UIEvent/which /ja/docs/Web/API/Navigator.getUserMedia /ja/docs/Web/API/Navigator/getUserMedia /ja/docs/Web/API/Navigator/registerContentHandler /ja/docs/orphaned/Web/API/Navigator/registerContentHandler /ja/docs/Web/API/NavigatorID /ja/docs/Web/API/Navigator diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index db3e031f5d..d59a68f7be 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -10699,12 +10699,6 @@ "Wind1808" ] }, - "Web/API/ByteString": { - "modified": "2020-03-11T12:49:49.193Z", - "contributors": [ - "mfuji09" - ] - }, "Web/API/CDATASection": { "modified": "2019-09-16T12:26:56.983Z", "contributors": [ @@ -18756,12 +18750,6 @@ "naturallucky" ] }, - "Web/API/MouseEvent/which": { - "modified": "2020-10-15T22:18:18.557Z", - "contributors": [ - "isdh" - ] - }, "Web/API/MutationObserver": { "modified": "2020-10-15T21:21:02.785Z", "contributors": [ @@ -22682,6 +22670,12 @@ "yyss" ] }, + "Web/API/UIEvent/which": { + "modified": "2020-10-15T22:18:18.557Z", + "contributors": [ + "isdh" + ] + }, "Web/API/URL": { "modified": "2020-10-15T21:33:06.267Z", "contributors": [ @@ -48609,6 +48603,12 @@ "sii" ] }, + "conflicting/Web/JavaScript/Reference/Global_Objects/String": { + "modified": "2020-03-11T12:49:49.193Z", + "contributors": [ + "mfuji09" + ] + }, "orphaned/Building_a_Mozilla_Distribution": { "modified": "2019-03-23T23:49:07.062Z", "contributors": [ diff --git a/files/ja/conflicting/web/javascript/reference/global_objects/string/index.html b/files/ja/conflicting/web/javascript/reference/global_objects/string/index.html new file mode 100644 index 0000000000..904fd7d989 --- /dev/null +++ b/files/ja/conflicting/web/javascript/reference/global_objects/string/index.html @@ -0,0 +1,44 @@ +--- +title: ByteString +slug: conflicting/Web/JavaScript/Reference/Global_Objects/String +tags: + - API + - ByteString + - DOM + - DOM Reference + - Reference + - String + - WebIDL + - インターフェイス +translation_of: Web/API/ByteString +original_slug: Web/API/ByteString +--- +
{{APIRef("DOM")}}
+ +

ByteString は UTF-8 の文字列であり、一連のすべての可能性があるバイトの並びです。 ByteString は一般に JavaScript に返されるときに {{jsxref("String")}} に対応します。一般に、 HTTP などのバイト列と文字列を交換できるようなプロトコルにのみ使用されます。

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}初回定義
+ +

関連情報

+ + diff --git a/files/ja/web/api/bytestring/index.html b/files/ja/web/api/bytestring/index.html deleted file mode 100644 index b92bb846e3..0000000000 --- a/files/ja/web/api/bytestring/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: ByteString -slug: Web/API/ByteString -tags: - - API - - ByteString - - DOM - - DOM Reference - - Reference - - String - - WebIDL - - インターフェイス -translation_of: Web/API/ByteString ---- -
{{APIRef("DOM")}}
- -

ByteString は UTF-8 の文字列であり、一連のすべての可能性があるバイトの並びです。 ByteString は一般に JavaScript に返されるときに {{jsxref("String")}} に対応します。一般に、 HTTP などのバイト列と文字列を交換できるようなプロトコルにのみ使用されます。

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}初回定義
- -

関連情報

- - diff --git a/files/ja/web/api/mouseevent/which/index.html b/files/ja/web/api/mouseevent/which/index.html deleted file mode 100644 index 8334684b1e..0000000000 --- a/files/ja/web/api/mouseevent/which/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: MouseEvent.which -slug: Web/API/MouseEvent/which -tags: - - API - - DOM Events - - MouseEvent - - Non-standard - - Property - - Read-only - - Reference -translation_of: Web/API/MouseEvent/which ---- -

{{APIRef("DOM Events")}}

- -

{{Non-standard_header}}

- -

MouseEvent.which プロパティはマウスのボタンを押下したことを示す読み取り専用のプロパティです。このプロパティの標準的な代替は {{ domxref("MouseEvent.button") }} 及び {{ domxref("MouseEvent.buttons") }}です。

- -

構文

- -
var buttonPressed = instanceOfMouseEvent.which
-
- -

戻り値

- -

押下したボタンを示す数値型:

- - - -

左利き用に設定されたマウスの場合、ボタンの動作は逆になります。この場合、値は右から左に読み取られます。

- -

仕様

- -

仕様はありません。

- -

ブラウザ互換性

- - - -

{{Compat("api.MouseEvent.which")}}

- -

関連

- - diff --git a/files/ja/web/api/uievent/which/index.html b/files/ja/web/api/uievent/which/index.html new file mode 100644 index 0000000000..8b9612bd82 --- /dev/null +++ b/files/ja/web/api/uievent/which/index.html @@ -0,0 +1,53 @@ +--- +title: MouseEvent.which +slug: Web/API/UIEvent/which +tags: + - API + - DOM Events + - MouseEvent + - Non-standard + - Property + - Read-only + - Reference +translation_of: Web/API/MouseEvent/which +original_slug: Web/API/MouseEvent/which +--- +

{{APIRef("DOM Events")}}

+ +

{{Non-standard_header}}

+ +

MouseEvent.which プロパティはマウスのボタンを押下したことを示す読み取り専用のプロパティです。このプロパティの標準的な代替は {{ domxref("MouseEvent.button") }} 及び {{ domxref("MouseEvent.buttons") }}です。

+ +

構文

+ +
var buttonPressed = instanceOfMouseEvent.which
+
+ +

戻り値

+ +

押下したボタンを示す数値型:

+ + + +

左利き用に設定されたマウスの場合、ボタンの動作は逆になります。この場合、値は右から左に読み取られます。

+ +

仕様

+ +

仕様はありません。

+ +

ブラウザ互換性

+ + + +

{{Compat("api.MouseEvent.which")}}

+ +

関連

+ + diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index 8dbb1dd636..e9d4e75587 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -301,6 +301,7 @@ /ru/docs/Web/API/AudioContext/createPanner /ru/docs/Web/API/BaseAudioContext/createPanner /ru/docs/Web/API/AudioContext/currentTime /ru/docs/Web/API/BaseAudioContext/currentTime /ru/docs/Web/API/AudioContext/decodeAudioData /ru/docs/Web/API/BaseAudioContext/decodeAudioData +/ru/docs/Web/API/ByteString /ru/docs/conflicting/Web/JavaScript/Reference/Global_Objects/String /ru/docs/Web/API/CSS_Object_Model/ориентация_экрана /ru/docs/Web/API/CSS_Object_Model/Managing_screen_orientation /ru/docs/Web/API/Canvas_API/Tutorial/Использование_изображений /ru/docs/Web/API/Canvas_API/Tutorial/Using_images /ru/docs/Web/API/Canvas_API/Tutorial/Композиции /ru/docs/Web/API/Canvas_API/Tutorial/Compositing @@ -340,6 +341,8 @@ /ru/docs/Web/API/HTMLHyperlinkElementUtils/toString /ru/docs/Web/API/HTMLAnchorElement/toString /ru/docs/Web/API/HTMLHyperlinkElementUtils/username /ru/docs/Web/API/HTMLAnchorElement/username /ru/docs/Web/API/HTMLImageElement.Image /ru/docs/Web/API/HTMLImageElement/Image +/ru/docs/Web/API/KeyboardEvent/which /ru/docs/Web/API/UIEvent/which +/ru/docs/Web/API/MouseEvent/which /ru/docs/conflicting/Web/API/UIEvent/which /ru/docs/Web/API/NetworkInformation/connection /ru/docs/Web/API/Navigator/connection /ru/docs/Web/API/Node.appendChild /ru/docs/Web/API/Node/appendChild /ru/docs/Web/API/Node.contains /ru/docs/Web/API/Node/contains diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index 633ebd6995..388b670bc8 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -5730,13 +5730,6 @@ "sh7dm" ] }, - "Web/API/ByteString": { - "modified": "2019-09-13T04:40:19.326Z", - "contributors": [ - "ekirpichyov", - "opereverzeva" - ] - }, "Web/API/CDATASection": { "modified": "2020-10-15T22:08:24.955Z", "contributors": [ @@ -9241,12 +9234,6 @@ "Tvortsa" ] }, - "Web/API/KeyboardEvent/which": { - "modified": "2020-10-15T22:21:03.336Z", - "contributors": [ - "Dzvonek" - ] - }, "Web/API/Location": { "modified": "2019-08-09T02:31:05.855Z", "contributors": [ @@ -9493,12 +9480,6 @@ "insafski" ] }, - "Web/API/MouseEvent/which": { - "modified": "2020-10-15T22:15:09.701Z", - "contributors": [ - "InoY" - ] - }, "Web/API/MutationObserver": { "modified": "2020-10-15T21:47:37.351Z", "contributors": [ @@ -10517,6 +10498,12 @@ "idushii" ] }, + "Web/API/UIEvent/which": { + "modified": "2020-10-15T22:21:03.336Z", + "contributors": [ + "Dzvonek" + ] + }, "Web/API/URL": { "modified": "2020-10-18T22:13:20.099Z", "contributors": [ @@ -24246,6 +24233,12 @@ "Liubava77" ] }, + "conflicting/Web/API/UIEvent/which": { + "modified": "2020-10-15T22:15:09.701Z", + "contributors": [ + "InoY" + ] + }, "conflicting/Web/API/WebRTC_API": { "modified": "2019-03-23T22:34:55.398Z", "contributors": [ @@ -24556,14 +24549,10 @@ ] }, "conflicting/Web/JavaScript/Reference/Global_Objects/String": { - "modified": "2019-08-27T15:11:15.337Z", + "modified": "2019-09-13T04:40:19.326Z", "contributors": [ - "Yialo", - "EugeneTarasenko", - "ukrlex01", - "arctic-hare", - "webnarmin", - "Mingun" + "ekirpichyov", + "opereverzeva" ] }, "conflicting/Web/JavaScript/Reference/Global_Objects/Symbol": { diff --git a/files/ru/conflicting/web/api/uievent/which/index.html b/files/ru/conflicting/web/api/uievent/which/index.html new file mode 100644 index 0000000000..97f0afc8ad --- /dev/null +++ b/files/ru/conflicting/web/api/uievent/which/index.html @@ -0,0 +1,48 @@ +--- +title: MouseEvent.which +slug: conflicting/Web/API/UIEvent/which +tags: + - API + - "События\_DOM" +translation_of: Web/API/MouseEvent/which +original_slug: Web/API/MouseEvent/which +--- +

{{APIRef("DOM Events")}}

+ +

{{Non-standard_header}}

+ +

MouseEvent.which это свойство только для чтения которое показывает какая именно кнопка мыши вызвала событие MouseEvent. Стандартная альтернатива этому свойству – {{ domxref("MouseEvent.button") }} и {{ domxref("MouseEvent.buttons") }}.

+ +

Синтаксис

+ +
var buttonPressed = instanceOfMouseEvent.which
+
+ +

Возвращаемое значение

+ +

Значения соответствующие кнопкам:

+ + + +

Для мыши настроенной для левшей порядок значений будет изменён. В этом случае значению 1 будет соответствовать правая кнопка, а 3 – левая.

+ +

Спецификация

+ +

Это свойство не является частью спецификации.

+ +

Совместимость с браузерами

+ + + +

{{Compat("api.MouseEvent.which")}}

+ +

Смотрите также

+ + diff --git a/files/ru/conflicting/web/javascript/reference/global_objects/string/index.html b/files/ru/conflicting/web/javascript/reference/global_objects/string/index.html new file mode 100644 index 0000000000..bbf48536b8 --- /dev/null +++ b/files/ru/conflicting/web/javascript/reference/global_objects/string/index.html @@ -0,0 +1,35 @@ +--- +title: ByteString +slug: conflicting/Web/JavaScript/Reference/Global_Objects/String +tags: + - Строки +translation_of: Web/API/ByteString +original_slug: Web/API/ByteString +--- +
{{APIRef("DOM")}}
+ +

ByteString является UTF-8 строкой, которая соответствует набору всех возможных последовательностей байтов. ByteString отображается как {{jsxref("String")}} при возврате в JavaScript; как правило, используется только при взаимодействии с протоколами, которые равнозначно используют байты и строки, например HTTP.

+ +

Спецификации

+ + + + + + + + + + + + + + +
СпецификацияСтатусКомментарии
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}Изначальное определение
+ +

Смотрите также

+ + diff --git a/files/ru/web/api/bytestring/index.html b/files/ru/web/api/bytestring/index.html deleted file mode 100644 index 01993390ee..0000000000 --- a/files/ru/web/api/bytestring/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ByteString -slug: Web/API/ByteString -tags: - - Строки -translation_of: Web/API/ByteString ---- -
{{APIRef("DOM")}}
- -

ByteString является UTF-8 строкой, которая соответствует набору всех возможных последовательностей байтов. ByteString отображается как {{jsxref("String")}} при возврате в JavaScript; как правило, используется только при взаимодействии с протоколами, которые равнозначно используют байты и строки, например HTTP.

- -

Спецификации

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарии
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}Изначальное определение
- -

Смотрите также

- - diff --git a/files/ru/web/api/keyboardevent/which/index.html b/files/ru/web/api/keyboardevent/which/index.html deleted file mode 100644 index 0b78a32ab4..0000000000 --- a/files/ru/web/api/keyboardevent/which/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: KeyboardEvent.which -slug: Web/API/KeyboardEvent/which -tags: - - API - - DOM - - Deprecated - - Property - - Reference -translation_of: Web/API/KeyboardEvent/which ---- -
{{APIRef ("События DOM")}} {{Deprecated_header}}
-Свойство which только для чтения интерфейса {{domxref ("KeyboardEvent")}} возвращает числовой код клавиши нажатой клавиши или код символа (charCode) для нажатой буквенно-цифровой клавиши.
- - - -

Синтаксис

- -
var keyResult = event.which;
-
- -

Параметры

- - - -

Примеры

- -
<html>
-<head>
-<title>charCode/keyCode/which example</title>
-
-<script type="text/javascript">
-
-function showKeyPress(evt) {
-alert("onkeypress handler: \n"
-      + "keyCode property: " + evt.keyCode + "\n"
-      + "which property: " + evt.which + "\n"
-      + "charCode property: " + evt.charCode + "\n"
-      + "Character Key Pressed: "
-      + String.fromCharCode(evt.charCode) + "\n"
-     );
-}
-
-
-function keyDown(evt) {
-alert("onkeydown handler: \n"
-      + "keyCode property: " + evt.keyCode + "\n"
-      + "which property: " + evt.which + "\n"
-     );
-}
-
-</script>
-</head>
-
-<body
- onkeypress="showKeyPress(event);"
- onkeydown="keyDown(event);"
->
-
-<p>Please press any key.</p>
-
-</body>
-</html>
-
- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM3 Events','#legacy-interface-KeyboardEvent','KeyboardEvent.which')}}{{Spec2('DOM3 Events')}}Initial definition; specified as deprecated
- -

Browser compatibility

- - - -

{{Compat("api.KeyboardEvent.which")}}

- -

See also

- - diff --git a/files/ru/web/api/mouseevent/which/index.html b/files/ru/web/api/mouseevent/which/index.html deleted file mode 100644 index f2a4a8cf09..0000000000 --- a/files/ru/web/api/mouseevent/which/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: MouseEvent.which -slug: Web/API/MouseEvent/which -tags: - - API - - "События\_DOM" -translation_of: Web/API/MouseEvent/which ---- -

{{APIRef("DOM Events")}}

- -

{{Non-standard_header}}

- -

MouseEvent.which это свойство только для чтения которое показывает какая именно кнопка мыши вызвала событие MouseEvent. Стандартная альтернатива этому свойству – {{ domxref("MouseEvent.button") }} и {{ domxref("MouseEvent.buttons") }}.

- -

Синтаксис

- -
var buttonPressed = instanceOfMouseEvent.which
-
- -

Возвращаемое значение

- -

Значения соответствующие кнопкам:

- - - -

Для мыши настроенной для левшей порядок значений будет изменён. В этом случае значению 1 будет соответствовать правая кнопка, а 3 – левая.

- -

Спецификация

- -

Это свойство не является частью спецификации.

- -

Совместимость с браузерами

- - - -

{{Compat("api.MouseEvent.which")}}

- -

Смотрите также

- - diff --git a/files/ru/web/api/uievent/which/index.html b/files/ru/web/api/uievent/which/index.html new file mode 100644 index 0000000000..3c2fc530cc --- /dev/null +++ b/files/ru/web/api/uievent/which/index.html @@ -0,0 +1,98 @@ +--- +title: KeyboardEvent.which +slug: Web/API/UIEvent/which +tags: + - API + - DOM + - Deprecated + - Property + - Reference +translation_of: Web/API/KeyboardEvent/which +original_slug: Web/API/KeyboardEvent/which +--- +
{{APIRef ("События DOM")}} {{Deprecated_header}}
+Свойство which только для чтения интерфейса {{domxref ("KeyboardEvent")}} возвращает числовой код клавиши нажатой клавиши или код символа (charCode) для нажатой буквенно-цифровой клавиши.
+ + + +

Синтаксис

+ +
var keyResult = event.which;
+
+ +

Параметры

+ + + +

Примеры

+ +
<html>
+<head>
+<title>charCode/keyCode/which example</title>
+
+<script type="text/javascript">
+
+function showKeyPress(evt) {
+alert("onkeypress handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+      + "charCode property: " + evt.charCode + "\n"
+      + "Character Key Pressed: "
+      + String.fromCharCode(evt.charCode) + "\n"
+     );
+}
+
+
+function keyDown(evt) {
+alert("onkeydown handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+     );
+}
+
+</script>
+</head>
+
+<body
+ onkeypress="showKeyPress(event);"
+ onkeydown="keyDown(event);"
+>
+
+<p>Please press any key.</p>
+
+</body>
+</html>
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('DOM3 Events','#legacy-interface-KeyboardEvent','KeyboardEvent.which')}}{{Spec2('DOM3 Events')}}Initial definition; specified as deprecated
+ +

Browser compatibility

+ + + +

{{Compat("api.KeyboardEvent.which")}}

+ +

See also

+ + diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index ff820f35f0..35d2de28cb 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1235,6 +1235,7 @@ /zh-CN/docs/Web/API/Blob.size /zh-CN/docs/Web/API/Blob/size /zh-CN/docs/Web/API/Blob.slice /zh-CN/docs/Web/API/Blob/slice /zh-CN/docs/Web/API/Blob.type /zh-CN/docs/Web/API/Blob/type +/zh-CN/docs/Web/API/ByteString /zh-CN/docs/conflicting/Web/JavaScript/Reference/Global_Objects/String /zh-CN/docs/Web/API/CSSStyleSheet.insertRule /zh-CN/docs/Web/API/CSSStyleSheet/insertRule /zh-CN/docs/Web/API/CSS分页规则 /zh-CN/docs/Web/API/CSSPageRule /zh-CN/docs/Web/API/CanvasCaptureMediaStream /zh-CN/docs/Web/API/CanvasCaptureMediaStreamTrack @@ -1381,8 +1382,10 @@ /zh-CN/docs/Web/API/Index /zh-CN/docs/conflicting/Web/API /zh-CN/docs/Web/API/IndexedDB_API/IDBObjectStore /zh-CN/docs/Web/API/IDBObjectStore /zh-CN/docs/Web/API/Intersection_Observer_API/点观察者API的时序元素可见性 /zh-CN/docs/Web/API/Intersection_Observer_API/Timing_element_visibility +/zh-CN/docs/Web/API/KeyboardEvent/which /zh-CN/docs/Web/API/UIEvent/which /zh-CN/docs/Web/API/Location.replace /zh-CN/docs/Web/API/Location/replace /zh-CN/docs/Web/API/MediaStream.addTrack /zh-CN/docs/Web/API/MediaStream/addTrack +/zh-CN/docs/Web/API/MouseEvent/which /zh-CN/docs/conflicting/Web/API/UIEvent/which /zh-CN/docs/Web/API/Navigator.battery /zh-CN/docs/Web/API/Navigator/battery /zh-CN/docs/Web/API/Navigator.buildID /zh-CN/docs/Web/API/Navigator/buildID /zh-CN/docs/Web/API/Navigator.cookieEnabled /zh-CN/docs/Web/API/Navigator/cookieEnabled diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index ea8dba13d9..1d166827cc 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -8264,13 +8264,6 @@ "Spikef" ] }, - "Web/API/ByteString": { - "modified": "2019-07-13T11:30:42.104Z", - "contributors": [ - "RainSlide", - "zhouxu" - ] - }, "Web/API/CDATASection": { "modified": "2020-10-15T21:50:11.923Z", "contributors": [ @@ -16601,12 +16594,6 @@ "cuixiping" ] }, - "Web/API/KeyboardEvent/which": { - "modified": "2020-10-15T22:35:00.980Z", - "contributors": [ - "xgqfrms" - ] - }, "Web/API/LocalFileSystemSync": { "modified": "2019-03-23T22:09:04.520Z", "contributors": [ @@ -17290,12 +17277,6 @@ "Dcfm" ] }, - "Web/API/MouseEvent/which": { - "modified": "2019-03-18T21:11:17.379Z", - "contributors": [ - "WayneCui" - ] - }, "Web/API/MouseEvent/x": { "modified": "2019-03-23T22:05:16.814Z", "contributors": [ @@ -20821,6 +20802,12 @@ "pans9" ] }, + "Web/API/UIEvent/which": { + "modified": "2020-10-15T22:35:00.980Z", + "contributors": [ + "xgqfrms" + ] + }, "Web/API/URL": { "modified": "2020-10-15T21:33:08.666Z", "contributors": [ @@ -47300,6 +47287,12 @@ "hibernake" ] }, + "conflicting/Web/API/UIEvent/which": { + "modified": "2019-03-18T21:11:17.379Z", + "contributors": [ + "WayneCui" + ] + }, "conflicting/Web/API/URL": { "modified": "2019-03-23T22:22:37.359Z", "contributors": [ @@ -47829,23 +47822,10 @@ ] }, "conflicting/Web/JavaScript/Reference/Global_Objects/String": { - "modified": "2020-10-15T21:27:29.084Z", + "modified": "2019-07-13T11:30:42.104Z", "contributors": [ - "gqbre", - "pabloyshi", - "zhazhjie", - "zqyue", - "Ende93", - "midare", - "Yuxuan_Jiang", - "micheal-death", - "xgqfrms-GitHub", - "Hugh", - "terrycafe520", - "qianjiahao", - "paddingme", - "teoli", - "ziyunfei" + "RainSlide", + "zhouxu" ] }, "conflicting/Web/JavaScript/Reference/Global_Objects/Symbol": { diff --git a/files/zh-cn/conflicting/web/api/uievent/which/index.html b/files/zh-cn/conflicting/web/api/uievent/which/index.html new file mode 100644 index 0000000000..760958f975 --- /dev/null +++ b/files/zh-cn/conflicting/web/api/uievent/which/index.html @@ -0,0 +1,100 @@ +--- +title: MouseEvent.which +slug: conflicting/Web/API/UIEvent/which +tags: + - API + - 只读 + - 非标准 + - 鼠标事件 +translation_of: Web/API/MouseEvent/which +original_slug: Web/API/MouseEvent/which +--- +

{{APIRef("DOM Events")}}

+ +

{{Non-standard_header}}

+ +

只读属性 MouseEvent.which 显示了鼠标事件是由哪个鼠标按键被按下所触发的。其他获得该信息的标准属性是 {{ domxref("MouseEvent.button") }} 与 {{ domxref("MouseEvent.buttons") }} 。

+ +

语法

+ +
var buttonPressed = instanceOfMouseEvent.which
+
+ +

返回值

+ +

表示一个特定按键的数字:

+ + + +

如果鼠标被设置为适用于左利手人士使用,那么引发的动作恰好相反。在这种情况下,该值应该从右往左看。

+ +

规范

+ +

无规范定义该属性。

+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureEdgeFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop(1)}}[1]1.09.05.01.0
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureEdgeFirefox Mobile (Gecko)AndroidIE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{ CompatGeckoMobile(1) }} [1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

[1] 在 {{event("mousemove")}} 事件对象上, which 属性被错误地设定为 1 {{bug(1048294)}}.

+ +

相关内容

+ + diff --git a/files/zh-cn/conflicting/web/javascript/reference/global_objects/string/index.html b/files/zh-cn/conflicting/web/javascript/reference/global_objects/string/index.html new file mode 100644 index 0000000000..b2da7aeebf --- /dev/null +++ b/files/zh-cn/conflicting/web/javascript/reference/global_objects/string/index.html @@ -0,0 +1,41 @@ +--- +title: ByteString +slug: conflicting/Web/JavaScript/Reference/Global_Objects/String +tags: + - API + - DOM + - String + - WebIDL + - 参考 + - 字符串 +translation_of: Web/API/ByteString +original_slug: Web/API/ByteString +--- +

{{APIRef("DOM")}}

+ +

ByteString 是一个可以对应所有可能的字节序列的 UTF-8 字符串。在 JavaScript 中,当返回时 ByteString 时,它会映射到一个 {{jsxref("String")}} 上去; 通常,只有在和一些协议交互,进行字节和字符串的相互转换时,它才会被用到,例如 HTTP 协议。

+ +

规范

+ + + + + + + + + + + + + + +
规范状态备注
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}Initial definition.
+ +

参见

+ + diff --git a/files/zh-cn/web/api/bytestring/index.html b/files/zh-cn/web/api/bytestring/index.html deleted file mode 100644 index 7c3c0d004f..0000000000 --- a/files/zh-cn/web/api/bytestring/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: ByteString -slug: Web/API/ByteString -tags: - - API - - DOM - - String - - WebIDL - - 参考 - - 字符串 -translation_of: Web/API/ByteString ---- -

{{APIRef("DOM")}}

- -

ByteString 是一个可以对应所有可能的字节序列的 UTF-8 字符串。在 JavaScript 中,当返回时 ByteString 时,它会映射到一个 {{jsxref("String")}} 上去; 通常,只有在和一些协议交互,进行字节和字符串的相互转换时,它才会被用到,例如 HTTP 协议。

- -

规范

- - - - - - - - - - - - - - -
规范状态备注
{{SpecName('WebIDL', '#idl-ByteString', 'ByteString')}}{{Spec2('WebIDL')}}Initial definition.
- -

参见

- - diff --git a/files/zh-cn/web/api/keyboardevent/which/index.html b/files/zh-cn/web/api/keyboardevent/which/index.html deleted file mode 100644 index 56136f398e..0000000000 --- a/files/zh-cn/web/api/keyboardevent/which/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: KeyboardEvent.which -slug: Web/API/KeyboardEvent/which -tags: - - Code - - DOM - - Key - - KeyboardEvent - - keyCode - - which -translation_of: Web/API/KeyboardEvent/which ---- -
{{ APIRef("DOM Events") }} {{Deprecated_header}}
- -

{{domxref("KeyboardEvent")}} 接口的 which 只读属性返回所按下键的数字 keyCode 或所按下字母数字键的字符代码 (charCode) 。

- -

语法

- -
var keyResult = event.which;
-
- -

返回值

- - - -

例子

- -
<html>
-<head>
-<title>charCode/keyCode/which example</title>
-
-<script type="text/javascript">
-
-function showKeyPress(evt) {
-alert("onkeypress handler: \n"
-      + "keyCode property: " + evt.keyCode + "\n"
-      + "which property: " + evt.which + "\n"
-      + "charCode property: " + evt.charCode + "\n"
-      + "Character Key Pressed: "
-      + String.fromCharCode(evt.charCode) + "\n"
-     );
-}
-
-
-function keyDown(evt) {
-alert("onkeydown handler: \n"
-      + "keyCode property: " + evt.keyCode + "\n"
-      + "which property: " + evt.which + "\n"
-     );
-}
-
-</script>
-</head>
-
-<body
- onkeypress="showKeyPress(event);"
- onkeydown="keyDown(event);"
->
-
-<p>Please press any key.</p>
-
-</body>
-</html>
-
- -

规范

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM3 Events','#legacy-interface-KeyboardEvent','KeyboardEvent.which')}}{{Spec2('DOM3 Events')}}Initial definition; specified as deprecated
- -

浏览器兼容性

- - - -

{{Compat("api.KeyboardEvent.which")}}

- -

See also

- - - -
-
-
diff --git a/files/zh-cn/web/api/mouseevent/which/index.html b/files/zh-cn/web/api/mouseevent/which/index.html deleted file mode 100644 index 591412dda3..0000000000 --- a/files/zh-cn/web/api/mouseevent/which/index.html +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: MouseEvent.which -slug: Web/API/MouseEvent/which -tags: - - API - - 只读 - - 非标准 - - 鼠标事件 -translation_of: Web/API/MouseEvent/which ---- -

{{APIRef("DOM Events")}}

- -

{{Non-standard_header}}

- -

只读属性 MouseEvent.which 显示了鼠标事件是由哪个鼠标按键被按下所触发的。其他获得该信息的标准属性是 {{ domxref("MouseEvent.button") }} 与 {{ domxref("MouseEvent.buttons") }} 。

- -

语法

- -
var buttonPressed = instanceOfMouseEvent.which
-
- -

返回值

- -

表示一个特定按键的数字:

- - - -

如果鼠标被设置为适用于左利手人士使用,那么引发的动作恰好相反。在这种情况下,该值应该从右往左看。

- -

规范

- -

无规范定义该属性。

- -

浏览器兼容性

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureEdgeFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop(1)}}[1]1.09.05.01.0
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureEdgeFirefox Mobile (Gecko)AndroidIE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{ CompatGeckoMobile(1) }} [1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

[1] 在 {{event("mousemove")}} 事件对象上, which 属性被错误地设定为 1 {{bug(1048294)}}.

- -

相关内容

- - diff --git a/files/zh-cn/web/api/uievent/which/index.html b/files/zh-cn/web/api/uievent/which/index.html new file mode 100644 index 0000000000..b94bab0616 --- /dev/null +++ b/files/zh-cn/web/api/uievent/which/index.html @@ -0,0 +1,102 @@ +--- +title: KeyboardEvent.which +slug: Web/API/UIEvent/which +tags: + - Code + - DOM + - Key + - KeyboardEvent + - keyCode + - which +translation_of: Web/API/KeyboardEvent/which +original_slug: Web/API/KeyboardEvent/which +--- +
{{ APIRef("DOM Events") }} {{Deprecated_header}}
+ +

{{domxref("KeyboardEvent")}} 接口的 which 只读属性返回所按下键的数字 keyCode 或所按下字母数字键的字符代码 (charCode) 。

+ +

语法

+ +
var keyResult = event.which;
+
+ +

返回值

+ + + +

例子

+ +
<html>
+<head>
+<title>charCode/keyCode/which example</title>
+
+<script type="text/javascript">
+
+function showKeyPress(evt) {
+alert("onkeypress handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+      + "charCode property: " + evt.charCode + "\n"
+      + "Character Key Pressed: "
+      + String.fromCharCode(evt.charCode) + "\n"
+     );
+}
+
+
+function keyDown(evt) {
+alert("onkeydown handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+     );
+}
+
+</script>
+</head>
+
+<body
+ onkeypress="showKeyPress(event);"
+ onkeydown="keyDown(event);"
+>
+
+<p>Please press any key.</p>
+
+</body>
+</html>
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM3 Events','#legacy-interface-KeyboardEvent','KeyboardEvent.which')}}{{Spec2('DOM3 Events')}}Initial definition; specified as deprecated
+ +

浏览器兼容性

+ + + +

{{Compat("api.KeyboardEvent.which")}}

+ +

See also

+ + + +
+
+
-- cgit v1.2.3-54-g00ecf