From 68b6aba0b2a1f8005e1c181c06e40eea4af9cd2f Mon Sep 17 00:00:00 2001 From: MDN Date: Sun, 4 Jul 2021 00:36:02 +0000 Subject: [CRON] sync translated content --- files/zh-cn/_redirects.txt | 5 +- files/zh-cn/_wikihistory.json | 22 ++-- .../api/htmlorforeignelement/dataset/index.html | 124 +++++++++++++++++++++ .../api/htmlorforeignelement/dataset/index.html | 124 --------------------- 4 files changed, 138 insertions(+), 137 deletions(-) create mode 100644 files/zh-cn/orphaned/web/api/htmlorforeignelement/dataset/index.html delete mode 100644 files/zh-cn/web/api/htmlorforeignelement/dataset/index.html (limited to 'files/zh-cn') diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 700295744c..8917908d39 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1622,7 +1622,7 @@ /zh-CN/docs/Web/API/HTMLElement.blur /zh-CN/docs/Web/API/HTMLOrForeignElement/blur /zh-CN/docs/Web/API/HTMLElement.click /zh-CN/docs/Web/API/HTMLElement/click /zh-CN/docs/Web/API/HTMLElement.contentEditable /zh-CN/docs/Web/API/HTMLElement/contentEditable -/zh-CN/docs/Web/API/HTMLElement.dataset /zh-CN/docs/Web/API/HTMLOrForeignElement/dataset +/zh-CN/docs/Web/API/HTMLElement.dataset /zh-CN/docs/orphaned/Web/API/HTMLOrForeignElement/dataset /zh-CN/docs/Web/API/HTMLElement.dir /zh-CN/docs/Web/API/HTMLElement/dir /zh-CN/docs/Web/API/HTMLElement.focus /zh-CN/docs/Web/API/HTMLOrForeignElement/focus /zh-CN/docs/Web/API/HTMLElement.isContentEditable /zh-CN/docs/Web/API/HTMLElement/isContentEditable @@ -1635,7 +1635,7 @@ /zh-CN/docs/Web/API/HTMLElement.tabIndex /zh-CN/docs/Web/API/HTMLOrForeignElement/tabIndex /zh-CN/docs/Web/API/HTMLElement.title /zh-CN/docs/Web/API/HTMLElement/title /zh-CN/docs/Web/API/HTMLElement/blur /zh-CN/docs/Web/API/HTMLOrForeignElement/blur -/zh-CN/docs/Web/API/HTMLElement/dataset /zh-CN/docs/Web/API/HTMLOrForeignElement/dataset +/zh-CN/docs/Web/API/HTMLElement/dataset /zh-CN/docs/orphaned/Web/API/HTMLOrForeignElement/dataset /zh-CN/docs/Web/API/HTMLElement/focus /zh-CN/docs/Web/API/HTMLOrForeignElement/focus /zh-CN/docs/Web/API/HTMLElement/forceSpellCheck /zh-CN/docs/orphaned/Web/API/HTMLElement/forceSpellCheck /zh-CN/docs/Web/API/HTMLElement/nonce /zh-CN/docs/Web/API/HTMLOrForeignElement/nonce @@ -1655,6 +1655,7 @@ /zh-CN/docs/Web/API/HTMLHyperlinkElementUtils/username /zh-CN/docs/Web/API/HTMLAnchorElement/username /zh-CN/docs/Web/API/HTMLInputElement.mozSetFileNameArray /zh-CN/docs/conflicting/Web/API/HTMLInputElement /zh-CN/docs/Web/API/HTMLInputElement/mozSetFileNameArray /zh-CN/docs/conflicting/Web/API/HTMLInputElement +/zh-CN/docs/Web/API/HTMLOrForeignElement/dataset /zh-CN/docs/orphaned/Web/API/HTMLOrForeignElement/dataset /zh-CN/docs/Web/API/HTMLTableElement.deleteTHead /zh-CN/docs/Web/API/HTMLTableElement/deleteTHead /zh-CN/docs/Web/API/IDBCursor.direction /zh-CN/docs/Web/API/IDBCursor/direction /zh-CN/docs/Web/API/IDBFactory.open /zh-CN/docs/Web/API/IDBFactory/open diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 32a7ea623b..c45954d8fe 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -15690,17 +15690,6 @@ "ziyunfei" ] }, - "Web/API/HTMLOrForeignElement/dataset": { - "modified": "2019-08-08T12:52:36.012Z", - "contributors": [ - "ilexwg", - "xgqfrms-GitHub", - "teoli", - "ziyunfei", - "ReyCG_sub", - "ReyCG" - ] - }, "Web/API/HTMLOrForeignElement/focus": { "modified": "2020-10-15T21:06:47.253Z", "contributors": [ @@ -49926,6 +49915,17 @@ "teoli" ] }, + "orphaned/Web/API/HTMLOrForeignElement/dataset": { + "modified": "2019-08-08T12:52:36.012Z", + "contributors": [ + "ilexwg", + "xgqfrms-GitHub", + "teoli", + "ziyunfei", + "ReyCG_sub", + "ReyCG" + ] + }, "orphaned/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB": { "modified": "2019-09-29T21:07:32.199Z", "contributors": [ diff --git a/files/zh-cn/orphaned/web/api/htmlorforeignelement/dataset/index.html b/files/zh-cn/orphaned/web/api/htmlorforeignelement/dataset/index.html new file mode 100644 index 0000000000..6607ae59b3 --- /dev/null +++ b/files/zh-cn/orphaned/web/api/htmlorforeignelement/dataset/index.html @@ -0,0 +1,124 @@ +--- +title: HTMLElement.dataset +slug: orphaned/Web/API/HTMLOrForeignElement/dataset +tags: + - HTMLElement.dataset +translation_of: Web/API/HTMLOrForeignElement/dataset +original_slug: Web/API/HTMLOrForeignElement/dataset +--- +

{{ APIRef }}

+ +

HTMLElement.dataset属性允许无论是在读取模式和写入模式下访问在 HTML或 DOM中的元素上设置的所有自定义数据属性(data-*)集。

+ +

它是一个DOMString的映射,每个自定义数据属性的一个条目。

+ +

请注意,dataset 属性本身可以被读取,但不能直接写入。相反,所有的写入必须是它的“属性”,这反过来表示数据属性。

+ +

还要注意,一个HTML data-attribute 及其对应的DOM dataset.property 不共享相同的名称,但它们总是相似的:

+ + + +

 

+ +

自定义的数据属性名称是以 data- 开头的。 它必须要遵循 the production rule of xml names 规则,该规则是说它只可以包含字母,数字和下面的字符: dash (-), dot (.), colon (:), underscore (_)。此外不应包含ASCII 码大写字母。

+ +

自定义的data 属性名称转化成 {{ domxref("DOMStringMap") }} 的键值时会遵循下面的规则:

+ + + +

与此相反的转换,即将键值转换为一个属性的名称,会遵循下面的规则:

+ + + +

上面规则的约束是为了保证这两种转换是正好相反的转换。

+ +

例如,属性名称 data-abc-def 与键值 abcDef 相对应。

+ +

语法

+ +
string = element.dataset.camelCasedName;
+element.dataset.camelCasedName = string;
+ +

实例

+ +
<div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>John Doe
+</div>
+
+var el = document.querySelector('#user');
+
+// el.id == 'user'
+// el.dataset.id === '1234567890'
+// el.dataset.user === 'johndoe'
+// el.dataset.dateOfBirth === ''
+
+el.dataset.dateOfBirth = '1960-10-03'; // set the DOB.
+
+// 'someDataAttr' in el.dataset === false
+
+el.dataset.someDataAttr = 'mydata';
+// 'someDataAttr' in el.dataset === true
+
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support8{{ CompatGeckoDesktop("6.0") }}1111.106
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support---------------
+
+ +

 

diff --git a/files/zh-cn/web/api/htmlorforeignelement/dataset/index.html b/files/zh-cn/web/api/htmlorforeignelement/dataset/index.html deleted file mode 100644 index bb7e0977e7..0000000000 --- a/files/zh-cn/web/api/htmlorforeignelement/dataset/index.html +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: HTMLElement.dataset -slug: Web/API/HTMLOrForeignElement/dataset -tags: - - HTMLElement.dataset -translation_of: Web/API/HTMLOrForeignElement/dataset -original_slug: Web/API/HTMLElement/dataset ---- -

{{ APIRef }}

- -

HTMLElement.dataset属性允许无论是在读取模式和写入模式下访问在 HTML或 DOM中的元素上设置的所有自定义数据属性(data-*)集。

- -

它是一个DOMString的映射,每个自定义数据属性的一个条目。

- -

请注意,dataset 属性本身可以被读取,但不能直接写入。相反,所有的写入必须是它的“属性”,这反过来表示数据属性。

- -

还要注意,一个HTML data-attribute 及其对应的DOM dataset.property 不共享相同的名称,但它们总是相似的:

- - - -

 

- -

自定义的数据属性名称是以 data- 开头的。 它必须要遵循 the production rule of xml names 规则,该规则是说它只可以包含字母,数字和下面的字符: dash (-), dot (.), colon (:), underscore (_)。此外不应包含ASCII 码大写字母。

- -

自定义的data 属性名称转化成 {{ domxref("DOMStringMap") }} 的键值时会遵循下面的规则:

- - - -

与此相反的转换,即将键值转换为一个属性的名称,会遵循下面的规则:

- - - -

上面规则的约束是为了保证这两种转换是正好相反的转换。

- -

例如,属性名称 data-abc-def 与键值 abcDef 相对应。

- -

语法

- -
string = element.dataset.camelCasedName;
-element.dataset.camelCasedName = string;
- -

实例

- -
<div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>John Doe
-</div>
-
-var el = document.querySelector('#user');
-
-// el.id == 'user'
-// el.dataset.id === '1234567890'
-// el.dataset.user === 'johndoe'
-// el.dataset.dateOfBirth === ''
-
-el.dataset.dateOfBirth = '1960-10-03'; // set the DOB.
-
-// 'someDataAttr' in el.dataset === false
-
-el.dataset.someDataAttr = 'mydata';
-// 'someDataAttr' in el.dataset === true
-
- -

浏览器兼容性

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support8{{ CompatGeckoDesktop("6.0") }}1111.106
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support---------------
-
- -

 

-- cgit v1.2.3-54-g00ecf