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/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 +++++++++++++++++++++ 4 files changed, 102 insertions(+), 240 deletions(-) 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/zh-cn/web/api') 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