From c6ae29cf7792f79886c1bdfa5906f9521c9e9fe2 Mon Sep 17 00:00:00 2001 From: Jason Ren <40999116+jasonren0403@users.noreply.github.com> Date: Tue, 31 Oct 2023 03:48:17 +0000 Subject: [PATCH 1/4] =?UTF-8?q?chore(zh-cn):=20batch=20replace=20'?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=93=BE=E6=8E=A5'=20to=20=E2=80=98=E5=8F=82?= =?UTF-8?q?=E8=A7=81'=20part=202=20&=20minor=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zh-cn/web/api/cssstylerule/style/index.md | 17 ++++------ files/zh-cn/web/api/fetch/index.md | 6 ++-- files/zh-cn/web/api/filereader/abort/index.md | 2 +- files/zh-cn/web/api/filereader/error/index.md | 2 +- .../web/api/filereader/filereader/index.md | 4 +-- files/zh-cn/web/api/filereader/index.md | 5 +-- .../api/filereader/readasarraybuffer/index.md | 2 +- .../filereader/readasbinarystring/index.md | 2 +- files/zh-cn/web/api/filereadersync/index.md | 9 +++--- files/zh-cn/web/api/filesystem/index.md | 8 ++--- files/zh-cn/web/api/formdata/append/index.md | 6 ++-- files/zh-cn/web/api/formdata/entries/index.md | 6 ++-- .../zh-cn/web/api/formdata/formdata/index.md | 6 ++-- files/zh-cn/web/api/formdata/get/index.md | 6 ++-- files/zh-cn/web/api/formdata/getall/index.md | 6 ++-- files/zh-cn/web/api/formdata/has/index.md | 6 ++-- files/zh-cn/web/api/formdata/keys/index.md | 6 ++-- files/zh-cn/web/api/formdata/set/index.md | 6 ++-- .../formdata/using_formdata_objects/index.md | 6 ++-- files/zh-cn/web/api/formdata/values/index.md | 6 ++-- files/zh-cn/web/api/headers/index.md | 6 ++-- files/zh-cn/web/api/headers/keys/index.md | 6 ++-- files/zh-cn/web/api/response/index.md | 6 ++-- files/zh-cn/web/api/response/json/index.md | 6 ++-- files/zh-cn/web/api/response/ok/index.md | 6 ++-- .../web/api/response/redirected/index.md | 6 ++-- .../zh-cn/web/api/screen/colordepth/index.md | 18 +++++------ .../zh-cn/web/api/screen/pixeldepth/index.md | 16 ++++------ .../api/url/createobjecturl_static/index.md | 8 ++--- files/zh-cn/web/api/url/index.md | 9 +++--- files/zh-cn/web/api/worker/index.md | 10 +++--- .../web/api/xmlhttprequest/abort/index.md | 2 +- .../xmlhttprequest/progress_event/index.md | 8 ++--- .../api/xmlhttprequest/responsetype/index.md | 7 +++-- .../api/xmlhttprequest/timeout_event/index.md | 2 +- .../reference/operators/function/index.md | 10 +++--- .../operators/function_star_/index.md | 12 +++---- .../reference/operators/in/index.md | 6 ++-- .../reference/operators/instanceof/index.md | 3 +- .../reference/operators/new.target/index.md | 6 ++-- .../operators/spread_syntax/index.md | 6 ++-- .../reference/operators/this/index.md | 5 ++- .../reference/operators/yield_star_/index.md | 4 +-- .../reference/statements/block/index.md | 2 +- .../reference/statements/break/index.md | 4 +-- .../reference/statements/const/index.md | 4 +-- .../reference/statements/do...while/index.md | 4 ++- .../reference/statements/empty/index.md | 2 +- .../statements/for-await...of/index.md | 2 +- .../reference/statements/for...in/index.md | 6 ++-- .../reference/statements/for...of/index.md | 3 +- .../reference/statements/function/index.md | 13 ++++---- .../statements/function_star_/index.md | 31 ++++++++++--------- .../reference/statements/if...else/index.md | 4 +-- .../reference/statements/import/index.md | 19 ++++++------ .../reference/statements/switch/index.md | 4 +-- .../reference/statements/throw/index.md | 5 +-- .../reference/statements/try...catch/index.md | 2 +- .../javascript/reference/strict_mode/index.md | 14 +++------ 59 files changed, 186 insertions(+), 218 deletions(-) diff --git a/files/zh-cn/web/api/cssstylerule/style/index.md b/files/zh-cn/web/api/cssstylerule/style/index.md index 108a8d42a7d53e..4fc1476ad06b63 100644 --- a/files/zh-cn/web/api/cssstylerule/style/index.md +++ b/files/zh-cn/web/api/cssstylerule/style/index.md @@ -5,17 +5,15 @@ slug: Web/API/CSSStyleRule/style {{ ApiRef() }} -### 概述 - 返回 一个 {{ domxref("CSSStyleDeclaration") }}接口对象,它代表了{{ DOMXref("CSSRule") }}的 [declaration block](http://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#block)。 -### 语法 +## 语法 ```plain styleObj = cssRule.style ``` -### 例子 +## 例子 ```js function stilo() { @@ -24,18 +22,15 @@ function stilo() { // 弹出 "background-color: gray;" ``` -### 备注 +## 备注 declaration block 是样式规则中花括号内的部分(选择器就在花括号的外部) -### 相关链接 - -- [DOM CSS Properties](/zh-CN/CSS/CSS_Reference) -### 规范 +## 规范 -[DOM Level 2 CSS: style](http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule-style) +{{Specifications}} -### 浏览器兼容性 +## 浏览器兼容性 {{Compat}} diff --git a/files/zh-cn/web/api/fetch/index.md b/files/zh-cn/web/api/fetch/index.md index adf2d6827799f2..7558db04cb61d4 100644 --- a/files/zh-cn/web/api/fetch/index.md +++ b/files/zh-cn/web/api/fetch/index.md @@ -124,9 +124,9 @@ var myRequest = new Request("flowers.jpg", myInit); {{Compat}} -## 相关链接 +## 参见 - [Fetch API](/zh-CN/docs/Web/API/Fetch_API) -- [ServiceWorker API](/zh-CN/docs/Web/API/ServiceWorker_API) -- [HTTP access control (CORS)](/zh-CN/docs/Web/HTTP/Access_control_CORS) +- [ServiceWorker API](/zh-CN/docs/Web/API/Service_Worker_API) +- [HTTP 访问控制(CORS)](/zh-CN/docs/Web/HTTP/CORS) - [HTTP](/zh-CN/docs/Web/HTTP) diff --git a/files/zh-cn/web/api/filereader/abort/index.md b/files/zh-cn/web/api/filereader/abort/index.md index 9ce27ac73d157c..04899ce53fbe89 100644 --- a/files/zh-cn/web/api/filereader/abort/index.md +++ b/files/zh-cn/web/api/filereader/abort/index.md @@ -26,6 +26,6 @@ instanceOfFileReader.abort(); {{Compat}} -## 相关链接 +## 参见 - {{domxref("FileReader")}} diff --git a/files/zh-cn/web/api/filereader/error/index.md b/files/zh-cn/web/api/filereader/error/index.md index 60c50cc3398b5b..ccd288031d6f8b 100644 --- a/files/zh-cn/web/api/filereader/error/index.md +++ b/files/zh-cn/web/api/filereader/error/index.md @@ -25,6 +25,6 @@ var error = instanceOfFileReader.error {{Compat}} -## 相关链接 +## 参见 - {{domxref("FileReader")}} diff --git a/files/zh-cn/web/api/filereader/filereader/index.md b/files/zh-cn/web/api/filereader/filereader/index.md index b4270166463bf2..885c4ef8b42e40 100644 --- a/files/zh-cn/web/api/filereader/filereader/index.md +++ b/files/zh-cn/web/api/filereader/filereader/index.md @@ -35,6 +35,6 @@ function printFile(file) { {{Specifications}} -## 相关链接 +## 参见 -- [Using files from web applications](/zh-CN/docs/Web/API/File/Using_files_from_web_applications) +- [在 web 应用程序中使用文件](/zh-CN/docs/Web/API/File_API/Using_files_from_web_applications) diff --git a/files/zh-cn/web/api/filereader/index.md b/files/zh-cn/web/api/filereader/index.md index ba44a4667e0649..84c273df2ea364 100644 --- a/files/zh-cn/web/api/filereader/index.md +++ b/files/zh-cn/web/api/filereader/index.md @@ -75,8 +75,9 @@ slug: Web/API/FileReader {{Compat}} -## 相关链接 +## 参见 -- [如何在 web 应用程序中使用文件](/zh-CN/Using_files_from_web_applications) +- [如何在 web 应用程序中使用文件](/zh-CN/docs/Web/API/File_API/Using_files_from_web_applications) - {{domxref("File")}} - {{domxref("Blob")}} +- {{domxref("FileReaderSync")}} diff --git a/files/zh-cn/web/api/filereader/readasarraybuffer/index.md b/files/zh-cn/web/api/filereader/readasarraybuffer/index.md index 49b01d6f11a3cc..27ebd677e429a8 100644 --- a/files/zh-cn/web/api/filereader/readasarraybuffer/index.md +++ b/files/zh-cn/web/api/filereader/readasarraybuffer/index.md @@ -26,6 +26,6 @@ instanceOfFileReader.readAsArrayBuffer(blob); {{Compat}} -## 相关链接 +## 参见 - {{domxref("FileReader")}} diff --git a/files/zh-cn/web/api/filereader/readasbinarystring/index.md b/files/zh-cn/web/api/filereader/readasbinarystring/index.md index 863571f8176a29..2ac344ba0d95b9 100644 --- a/files/zh-cn/web/api/filereader/readasbinarystring/index.md +++ b/files/zh-cn/web/api/filereader/readasbinarystring/index.md @@ -56,6 +56,6 @@ canvas.toBlob(function (blob) { {{Compat}} -## 相关链接 +## 参见 - {{domxref("FileReader")}} diff --git a/files/zh-cn/web/api/filereadersync/index.md b/files/zh-cn/web/api/filereadersync/index.md index b1af8abe72309f..8fb9bfae2c8e8b 100644 --- a/files/zh-cn/web/api/filereadersync/index.md +++ b/files/zh-cn/web/api/filereadersync/index.md @@ -179,7 +179,7 @@ String readAsDataURL( - `EncodingError` - : 当资源是一个 data URL,并且超过了浏览器的限制大小时触发该异常。 -## Specifications +## 规范 {{Specifications}} @@ -187,7 +187,8 @@ String readAsDataURL( {{Compat}} -## 相关链接 +## 参见 -- [File API Specification: FileReaderSync](https://www.w3.org/TR/FileAPI/#FileReaderSync) -- Related interfaces: {{ domxref("FileReader") }}, {{ domxref("BlobBuilder") }}, {{ domxref("File") }}, {{ domxref("Blob") }} +- {{DOMxRef("FileReader")}} +- {{DOMxRef("Blob")}} +- {{DOMxRef("File")}} diff --git a/files/zh-cn/web/api/filesystem/index.md b/files/zh-cn/web/api/filesystem/index.md index afb2b7ad17e17f..ac169adbb5d6a3 100644 --- a/files/zh-cn/web/api/filesystem/index.md +++ b/files/zh-cn/web/api/filesystem/index.md @@ -33,8 +33,8 @@ slug: Web/API/FileSystem {{Compat}} -## 相关链接 +## 参见 -引用:[File System API](/zh-CN/DOM/File_API/File_System_API) - -介绍:[Basic Concepts About the File System API](/zh-CN/DOM/File_APIs/Filesystem/Basic_Concepts_About_the_Filesystem_API) +- [文件与目录条目 API](/zh-CN/docs/Web/API/File_and_Directory_Entries_API) +- [文件与目录条目 API 介绍](/zh-CN/docs/Web/API/File_and_Directory_Entries_API/Introduction) +- {{domxref("FileSystemEntry")}}、{{domxref("FileSystemFileEntry")}} 和 {{domxref("FileSystemDirectoryEntry")}} diff --git a/files/zh-cn/web/api/formdata/append/index.md b/files/zh-cn/web/api/formdata/append/index.md index cd77f5ab9bff9d..d14b4fe74dba71 100644 --- a/files/zh-cn/web/api/formdata/append/index.md +++ b/files/zh-cn/web/api/formdata/append/index.md @@ -67,9 +67,7 @@ formData.append("userpic[]", myFileInput2.files[0], "chris2.jpg"); {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/entries/index.md b/files/zh-cn/web/api/formdata/entries/index.md index 7d478a4d3bed9d..0c28e2fc4d0526 100644 --- a/files/zh-cn/web/api/formdata/entries/index.md +++ b/files/zh-cn/web/api/formdata/entries/index.md @@ -48,9 +48,7 @@ key2, value2 {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/formdata/index.md b/files/zh-cn/web/api/formdata/formdata/index.md index 656d5a9adf69a2..fdca834380a9d2 100644 --- a/files/zh-cn/web/api/formdata/formdata/index.md +++ b/files/zh-cn/web/api/formdata/formdata/index.md @@ -73,9 +73,7 @@ formData = new FormData(myForm); 在 Gecko 7.0 之前,如果你将{{domxref("Blob")}}作为数据添加到 form 对象中,文件名就是空的,这可能导致服务器在 HTTP 头的 Content-Disposition 中设置的文件名为空而引起错误。从 Gecko 7.0 开始,将会使用"blob"作为 Blob 数据的文件名。 -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/get/index.md b/files/zh-cn/web/api/formdata/get/index.md index 0dae07bc5ef160..a805cfd6876d85 100644 --- a/files/zh-cn/web/api/formdata/get/index.md +++ b/files/zh-cn/web/api/formdata/get/index.md @@ -53,9 +53,7 @@ formData.get("username"); // Returns "Chris" {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/getall/index.md b/files/zh-cn/web/api/formdata/getall/index.md index 2155fdae1231b8..94f34c2456d856 100644 --- a/files/zh-cn/web/api/formdata/getall/index.md +++ b/files/zh-cn/web/api/formdata/getall/index.md @@ -53,9 +53,7 @@ formData.getAll("username"); // Returns ["Chris", "Bob"] {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [使用 XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [使用 FormData 对象](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/has/index.md b/files/zh-cn/web/api/formdata/has/index.md index 9f86945ced5713..38790d5573d3fc 100644 --- a/files/zh-cn/web/api/formdata/has/index.md +++ b/files/zh-cn/web/api/formdata/has/index.md @@ -48,9 +48,7 @@ formData.has("username"); // Returns true {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/keys/index.md b/files/zh-cn/web/api/formdata/keys/index.md index ad8b8e704b58a0..34b8f7744f7e36 100644 --- a/files/zh-cn/web/api/formdata/keys/index.md +++ b/files/zh-cn/web/api/formdata/keys/index.md @@ -48,9 +48,7 @@ key2 {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/set/index.md b/files/zh-cn/web/api/formdata/set/index.md index 8d4875b48e6d35..7e2fa65e454436 100644 --- a/files/zh-cn/web/api/formdata/set/index.md +++ b/files/zh-cn/web/api/formdata/set/index.md @@ -55,9 +55,7 @@ formData.set("userpic", myFileInput.files[0], "chris.jpg"); {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/formdata/using_formdata_objects/index.md b/files/zh-cn/web/api/formdata/using_formdata_objects/index.md index c7b5e97067ce14..5ed208efb3a9d9 100644 --- a/files/zh-cn/web/api/formdata/using_formdata_objects/index.md +++ b/files/zh-cn/web/api/formdata/using_formdata_objects/index.md @@ -150,9 +150,9 @@ $.ajax({ 如果你想知道不使用 FormData 对象的情况下,通过[AJAX](/zh-CN/docs/AJAX)序列化和提交表单 [请点击这里](/zh-CN/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Submitting_forms_and_uploading_files)。 -## 相关链接 +## 参见 -- [Using XMLHttpRequest](/zh-CN/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest) +- [使用 XMLHttpRequest](/zh-CN/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest) - {{domxref("HTMLFormElement")}} - {{domxref("Blob")}} -- [Typed Arrays](/zh-CN/docs/Web/JavaScript/Typed_arrays) +- [类型化数组](/zh-CN/docs/Web/JavaScript/Guide/Typed_arrays) diff --git a/files/zh-cn/web/api/formdata/values/index.md b/files/zh-cn/web/api/formdata/values/index.md index a59b939ebfe5db..fa0e55184d04d0 100644 --- a/files/zh-cn/web/api/formdata/values/index.md +++ b/files/zh-cn/web/api/formdata/values/index.md @@ -48,9 +48,7 @@ value2 {{Compat}} -## 相关链接 +## 参见 -- {{domxref("XMLHTTPRequest")}} -- [Using XMLHttpRequest](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest) -- [Using FormData objects](/zh-CN/docs/DOM/XMLHttpRequest/FormData/Using_FormData_Objects) +- [使用 FormData 对象](/zh-CN/docs/Web/API/FormData/Using_FormData_Objects) - {{HTMLElement("Form")}} diff --git a/files/zh-cn/web/api/headers/index.md b/files/zh-cn/web/api/headers/index.md index e5e64506fc18e3..00b1db41268d2d 100644 --- a/files/zh-cn/web/api/headers/index.md +++ b/files/zh-cn/web/api/headers/index.md @@ -73,8 +73,8 @@ myHeaders.get("Content-Type"); {{Compat}} -## 相关链接 +## 参见 -- [ServiceWorker API](/zh-CN/docs/Web/API/ServiceWorker_API) -- [HTTP access control (CORS)](/zh-CN/docs/Web/HTTP/Access_control_CORS) +- [ServiceWorker API](/zh-CN/docs/Web/API/Service_Worker_API) +- [HTTP 访问控制(CORS)](/zh-CN/docs/Web/HTTP/CORS) - [HTTP](/zh-CN/docs/Web/HTTP) diff --git a/files/zh-cn/web/api/headers/keys/index.md b/files/zh-cn/web/api/headers/keys/index.md index d5903d7b28fc8c..bdd55b673bc5b4 100644 --- a/files/zh-cn/web/api/headers/keys/index.md +++ b/files/zh-cn/web/api/headers/keys/index.md @@ -44,8 +44,8 @@ vary {{Compat}} -## 相关链接 +## 参见 -- [ServiceWorker API](/zh-CN/docs/Web/API/ServiceWorker_API) -- [HTTP access control (CORS)](/zh-CN/docs/Web/HTTP/Access_control_CORS) +- [ServiceWorker API](/zh-CN/docs/Web/API/Service_Worker_API) +- [HTTP 访问控制(CORS)](/zh-CN/docs/Web/HTTP/CORS) - [HTTP](/zh-CN/docs/Web/HTTP) diff --git a/files/zh-cn/web/api/response/index.md b/files/zh-cn/web/api/response/index.md index 13815ab0c9cb73..449a83ceac7ee8 100644 --- a/files/zh-cn/web/api/response/index.md +++ b/files/zh-cn/web/api/response/index.md @@ -92,8 +92,8 @@ const response = new Response(); {{Compat}} -## 相关链接 +## 参见 -- [ServiceWorker API](/zh-CN/docs/Web/API/ServiceWorker_API) -- [HTTP access control (CORS)](/zh-CN/docs/Web/HTTP/Access_control_CORS) +- [ServiceWorker API](/zh-CN/docs/Web/API/Service_Worker_API) +- [HTTP 访问控制(CORS)](/zh-CN/docs/Web/HTTP/CORS) - [HTTP](/zh-CN/docs/Web/HTTP) diff --git a/files/zh-cn/web/api/response/json/index.md b/files/zh-cn/web/api/response/json/index.md index cb10e377f15b7d..d80be00efcc1fb 100644 --- a/files/zh-cn/web/api/response/json/index.md +++ b/files/zh-cn/web/api/response/json/index.md @@ -53,8 +53,8 @@ fetch(myRequest) {{Compat}} -## 相关链接 +## 参见 -- [ServiceWorker API](/zh-CN/docs/Web/API/ServiceWorker_API) -- [HTTP access control (CORS)](/zh-CN/docs/Web/HTTP/Access_control_CORS) +- [ServiceWorker API](/zh-CN/docs/Web/API/Service_Worker_API) +- [HTTP 访问控制(CORS)](/zh-CN/docs/Web/HTTP/CORS) - [HTTP](/zh-CN/docs/Web/HTTP) diff --git a/files/zh-cn/web/api/response/ok/index.md b/files/zh-cn/web/api/response/ok/index.md index 1b455cd441409a..6e20fec7ffb0dd 100644 --- a/files/zh-cn/web/api/response/ok/index.md +++ b/files/zh-cn/web/api/response/ok/index.md @@ -45,8 +45,8 @@ fetch(myRequest).then(function (response) { {{Compat}} -## 相关链接 +## 参见 -- [ServiceWorker API](/zh-CN/docs/Web/API/ServiceWorker_API) -- [HTTP access control (CORS)](/zh-CN/docs/Web/HTTP/Access_control_CORS) +- [ServiceWorker API](/zh-CN/docs/Web/API/Service_Worker_API) +- [HTTP 访问控制(CORS)](/zh-CN/docs/Web/HTTP/CORS) - [HTTP](/zh-CN/docs/Web/HTTP) diff --git a/files/zh-cn/web/api/response/redirected/index.md b/files/zh-cn/web/api/response/redirected/index.md index d610293c20bea3..d16ed7f9beb6cb 100644 --- a/files/zh-cn/web/api/response/redirected/index.md +++ b/files/zh-cn/web/api/response/redirected/index.md @@ -65,9 +65,9 @@ fetch("awesome-picture.jpg", { redirect: "error" }) {{Compat}} -## 相关链接 +## 参见 - [Fetch API](/zh-CN/docs/Web/API/Fetch_API) -- [ServiceWorker API](/zh-CN/docs/Web/API/ServiceWorker_API) -- [HTTP access control (CORS)](/zh-CN/docs/Web/HTTP/Access_control_CORS) +- [ServiceWorker API](/zh-CN/docs/Web/API/Service_Worker_API) +- [HTTP 访问控制(CORS)](/zh-CN/docs/Web/HTTP/CORS) - [HTTP](/zh-CN/docs/Web/HTTP) diff --git a/files/zh-cn/web/api/screen/colordepth/index.md b/files/zh-cn/web/api/screen/colordepth/index.md index 26fa0a51a2fd06..e4ff03d4452bc7 100644 --- a/files/zh-cn/web/api/screen/colordepth/index.md +++ b/files/zh-cn/web/api/screen/colordepth/index.md @@ -3,21 +3,13 @@ title: Screen.colorDepth slug: Web/API/Screen/colorDepth --- -{{APIRef("CSSOM View")}} - -## 概述 +{{APIRef("CSSOM")}} 返回屏幕的颜色深度(color depth)。根据 CSSOM( CSS 对象模型 ) 视图,为兼容起见,该值总为 24。 -## 语法 - -```plain -bitDepth = window.screen.colorDepth -``` - ## 示例 -```plain +```js // 检测屏幕的颜色深度 if ( window.screen.colorDepth < 8) { // 使用低色彩版本页面 @@ -30,6 +22,10 @@ if ( window.screen.colorDepth < 8) { {{Specifications}} -## 相关链接 +## 浏览器兼容性 + +{{Compat}} + +## 参见 - {{domxref("Screen.pixelDepth")}} diff --git a/files/zh-cn/web/api/screen/pixeldepth/index.md b/files/zh-cn/web/api/screen/pixeldepth/index.md index 93f3776b9289bf..6e25023fce882a 100644 --- a/files/zh-cn/web/api/screen/pixeldepth/index.md +++ b/files/zh-cn/web/api/screen/pixeldepth/index.md @@ -3,18 +3,10 @@ title: Screen.pixelDepth slug: Web/API/Screen/pixelDepth --- -{{APIRef("CSSOM View")}} - -## 概述 +{{APIRef("CSSOM")}} 返回屏幕的位深度/色彩深度(bit depth)。根据 CSSOM( CSS 对象模型 ) 视图,为兼容起见,该值总为 24。 -## 语法 - -```plain -depth = window.screen.pixelDepth -``` - ## 示例 ```js @@ -30,6 +22,10 @@ if (window.screen.pixelDepth > 8) { {{Specifications}} -## 相关链接 +## 浏览器兼容性 + +{{Compat}} + +## 参见 - {{domxref("Screen.colorDepth")}} diff --git a/files/zh-cn/web/api/url/createobjecturl_static/index.md b/files/zh-cn/web/api/url/createobjecturl_static/index.md index 6d16223ff06f84..086ac71178172a 100644 --- a/files/zh-cn/web/api/url/createobjecturl_static/index.md +++ b/files/zh-cn/web/api/url/createobjecturl_static/index.md @@ -52,10 +52,10 @@ objectURL = URL.createObjectURL(object); {{Compat}} -## 相关链接 +## 参见 -- [在 web 应用程序中使用文件](/zh-CN/docs/Using_files_from_web_applications) -- [Using object URLs to display images](/zh-CN/docs/Using_files_from_web_applications#Example_Using_object_URLs_to_display_images) -- {{domxref("URL.revokeObjectURL()")}} +- [在 web 应用程序中使用文件](/zh-CN/docs/Web/API/File_API/Using_files_from_web_applications) +- [使用对象 URL 显示图像](/zh-CN/docs/Web/API/File_API/Using_files_from_web_applications#示例:使用对象_url_来显示图片) +- {{domxref("URL.revokeObjectURL_static", "URL.revokeObjectURL()")}} - {{domxref("HTMLMediaElement.srcObject")}} - {{domxref("FileReader.readAsDataURL()")}} diff --git a/files/zh-cn/web/api/url/index.md b/files/zh-cn/web/api/url/index.md index bba10e5f94c949..f8b094e7f8fb3b 100644 --- a/files/zh-cn/web/api/url/index.md +++ b/files/zh-cn/web/api/url/index.md @@ -105,9 +105,10 @@ const response = await fetch(new URL('http://www.example.com/démonstration.html {{Compat}} -## 相关链接 +## 参见 +- [`core-js` 中针对 `URL` 的 polyfill](https://github.com/zloirock/core-js#url-and-urlsearchparams) - [URL API](/zh-CN/docs/Web/API/URL_API) -- [What is a URL?](/zh-CN/docs/Learn/Common_questions/What_is_a_URL) -- Property to obtain a `URL` object: {{domxref("Window.URL")}}. -- {{domxref("URLSearchParams")}}. +- [什么是 URL?](/zh-CN/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL) +- 获取 `URL` 对象的属性:{{domxref("URL")}} +- {{domxref("URLSearchParams")}} diff --git a/files/zh-cn/web/api/worker/index.md b/files/zh-cn/web/api/worker/index.md index a7785563800242..ee64a740b7c519 100644 --- a/files/zh-cn/web/api/worker/index.md +++ b/files/zh-cn/web/api/worker/index.md @@ -71,9 +71,9 @@ first.onchange = function () { 浏览器的早期版本中,加载跨域的执行者脚本导致 `SecurityError`事件。根据规范的变更,而新版本的浏览器只有[`error`](/zh-CN/docs/Web/API/Element/error_event)事件发生 -## 相关链接 +## 参见 -- [Using web workers](/En/Using_web_workers) -- [Functions available to workers](/En/DOM/Worker/Functions_available_to_workers) -- Other kind of workers: {{ domxref("SharedWorker") }} and [ServiceWorker](/zh-CN/docs/Web/API/ServiceWorker_API). -- Non-standard, Gecko-specific workers: {{ domxref("ChromeWorker") }}, used by extensions. +- [使用 Web Worker](/zh-CN/docs/Web/API/Web_Workers_API/Using_web_workers) +- [Web Worker 可用的函数和类](/zh-CN/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers) +- 其他类型的 worker:{{ domxref("SharedWorker") }} 和 [ServiceWorker](/zh-CN/docs/Web/API/Service_Worker_API). +- [`OffscreenCanvas`](/zh-CN/docs/Web/API/OffscreenCanvas) 接口 diff --git a/files/zh-cn/web/api/xmlhttprequest/abort/index.md b/files/zh-cn/web/api/xmlhttprequest/abort/index.md index 280aeb951feb16..5cd923dd45dfff 100644 --- a/files/zh-cn/web/api/xmlhttprequest/abort/index.md +++ b/files/zh-cn/web/api/xmlhttprequest/abort/index.md @@ -44,6 +44,6 @@ if (OH_NOES_WE_NEED_TO_CANCEL_RIGHT_NOW_OR_ELSE) { {{Compat}} -## 相关链接 +## 参见 - [使用 XMLHttpRequest](/zh-CN/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest) diff --git a/files/zh-cn/web/api/xmlhttprequest/progress_event/index.md b/files/zh-cn/web/api/xmlhttprequest/progress_event/index.md index 88de92a9b8a9d5..b2b7ccf7018a9c 100644 --- a/files/zh-cn/web/api/xmlhttprequest/progress_event/index.md +++ b/files/zh-cn/web/api/xmlhttprequest/progress_event/index.md @@ -118,7 +118,7 @@ xhrButtonAbort.addEventListener("click", () => { }); ``` -#### Result +#### 结果 {{ EmbedLiveSample('Live_example', '100%', '150px') }} @@ -130,7 +130,7 @@ xhrButtonAbort.addEventListener("click", () => { {{Compat}} -## 相关链接 +## 参见 -- Related events: {{domxref("XMLHttpRequest/loadstart_event", "loadstart")}}, {{domxref("XMLHttpRequest/load_event", "load")}}, {{domxref("XMLHttpRequest/loadend_event", "loadend")}}, {{domxref("XMLHttpRequest/error_event", "error")}}, {{domxref("XMLHttpRequest/abort_event", "abort")}} -- [Monitoring progress](/zh-CN/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress) +- 相关事件:{{domxref("XMLHttpRequest/loadstart_event", "loadstart")}}、{{domxref("XMLHttpRequest/load_event", "load")}}、{{domxref("XMLHttpRequest/loadend_event", "loadend")}}、{{domxref("XMLHttpRequest/error_event", "error")}}、{{domxref("XMLHttpRequest/abort_event", "abort")}} +- [监测进度](/zh-CN/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#监测进度) diff --git a/files/zh-cn/web/api/xmlhttprequest/responsetype/index.md b/files/zh-cn/web/api/xmlhttprequest/responsetype/index.md index 7ef36d66eb8262..e8eb577ed9fa95 100644 --- a/files/zh-cn/web/api/xmlhttprequest/responsetype/index.md +++ b/files/zh-cn/web/api/xmlhttprequest/responsetype/index.md @@ -63,8 +63,9 @@ XHR 请求默认是异步的;它们仅通过在调用 {{DOMxRef("XMLHttpReques {{Compat}} -## 相关链接 +## 参见 - [使用 XMLHttpRequest](/zh-CN/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest) -- [HTML in XMLHttpRequest](/zh-CN/docs/Web/API/XMLHttpRequest/HTML_in_XMLHttpRequest) -- {{DOMxRef("XMLHttpRequest.response", "response")}}, {{DOMxRef("XMLHttpRequest.responseText", "responseText")}} 和 {{DOMxRef("XMLHttpRequest.responseXML", "responseXML")}} +- [XMLHttpRequest 中的 HTML](/zh-CN/docs/Web/API/XMLHttpRequest/HTML_in_XMLHttpRequest) +- 响应数据:{{domxref("XMLHttpRequest.response", "response")}}、 + {{domxref("XMLHttpRequest.responseText", "responseText")}} 和 {{domxref("XMLHttpRequest.responseXML", "responseXML")}} diff --git a/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.md b/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.md index c63e6d64ef8bcb..d07bfb7170aca5 100644 --- a/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.md +++ b/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.md @@ -49,6 +49,6 @@ client.send(); {{Compat}} -## 相关链接 +## 参见 - [XMLHttpRequest](/zh-CN/docs/Web/API/XMLHttpRequest) diff --git a/files/zh-cn/web/javascript/reference/operators/function/index.md b/files/zh-cn/web/javascript/reference/operators/function/index.md index 98cc4d411aeb96..f489300a4e225f 100644 --- a/files/zh-cn/web/javascript/reference/operators/function/index.md +++ b/files/zh-cn/web/javascript/reference/operators/function/index.md @@ -100,11 +100,9 @@ button.addEventListener("click", function (event) { {{Compat}} -## 相关链接 +## 参见 -- {{jsxref("Functions_and_function_scope", "Functions and function scope")}} +- {{jsxref("Functions/Arrow_functions", "箭头函数", "", 1)}} +- {{jsxref("Functions", "函数", "", 1)}} - {{jsxref("Function")}} -- {{jsxref("Statements/function", "function statement")}} -- {{jsxref("Statements/function*", "function* statement")}} -- {{jsxref("Operators/function*", "function* expression")}} -- {{jsxref("GeneratorFunction")}} +- {{jsxref("Statements/function", "function 语句")}} diff --git a/files/zh-cn/web/javascript/reference/operators/function_star_/index.md b/files/zh-cn/web/javascript/reference/operators/function_star_/index.md index 2d38996c3b3ab0..ac3155ee0e6a21 100644 --- a/files/zh-cn/web/javascript/reference/operators/function_star_/index.md +++ b/files/zh-cn/web/javascript/reference/operators/function_star_/index.md @@ -48,14 +48,10 @@ var x = function* (y) { {{Compat}} -## 相关链接 +## 参见 -- {{jsxref("Statements/function*", "function* statement")}} -- {{jsxref("GeneratorFunction")}} 对象 -- [The Iterator protocol](/zh-CN/docs/Web/JavaScript/Guide/The_Iterator_protocol) +- {{jsxref("Statements/function*", "function*")}} +- {{jsxref("GeneratorFunction")}} +- [迭代器协议](/zh-CN/docs/Web/JavaScript/Reference/Iteration_protocols) - {{jsxref("Operators/yield", "yield")}} - {{jsxref("Operators/yield*", "yield*")}} -- {{jsxref("Function")}} 对象 -- {{jsxref("Statements/function", "function statement")}} -- {{jsxref("Operators/function", "function expression")}} -- {{jsxref("Functions_and_function_scope", "Functions and function scope")}} diff --git a/files/zh-cn/web/javascript/reference/operators/in/index.md b/files/zh-cn/web/javascript/reference/operators/in/index.md index 9404a60632ee75..cb8205f18abba8 100644 --- a/files/zh-cn/web/javascript/reference/operators/in/index.md +++ b/files/zh-cn/web/javascript/reference/operators/in/index.md @@ -100,10 +100,10 @@ trees[3] = undefined; {{Compat}} -## 相关链接 +## 参见 - [`for...in`](/zh-CN/docs/Web/JavaScript/Reference/Statements/for...in) - [`delete`](/zh-CN/docs/JavaScript/Reference/Operators/delete) -- {{jsxref("Object.prototype.hasOwnProperty()")}} +- {{jsxref("Object.hasOwn()")}} - {{jsxref("Reflect.has()")}} -- [属性的可枚举性和所有权](/zh-CN/docs/Enumerability_and_ownership_of_properties) +- [属性的可枚举性和所有权](/zh-CN/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) diff --git a/files/zh-cn/web/javascript/reference/operators/instanceof/index.md b/files/zh-cn/web/javascript/reference/operators/instanceof/index.md index 84ab2094bb7ff8..e818fd8d7e575b 100644 --- a/files/zh-cn/web/javascript/reference/operators/instanceof/index.md +++ b/files/zh-cn/web/javascript/reference/operators/instanceof/index.md @@ -138,7 +138,8 @@ if (!mycar instanceof Car) {{Compat}} -## 相关链接 +## 参见 - [typeof](/zh-CN/docs/JavaScript/Reference/Operators/typeof) - {{jsxref("Symbol.hasInstance")}} +- {{jsxref("Object.prototype.isPrototypeOf")}} diff --git a/files/zh-cn/web/javascript/reference/operators/new.target/index.md b/files/zh-cn/web/javascript/reference/operators/new.target/index.md index 6210ccb899e131..8bfc4dbf954ac4 100644 --- a/files/zh-cn/web/javascript/reference/operators/new.target/index.md +++ b/files/zh-cn/web/javascript/reference/operators/new.target/index.md @@ -78,9 +78,9 @@ var d = new D(); // logs class D extends C{constructor(){super();}} {{Compat}} -## 相关链接 +## 参见 -- [Functions](/zh-CN/docs/Web/JavaScript/Reference/Functions) -- [Classes](/zh-CN/docs/Web/JavaScript/Reference/Classes) +- [函数](/zh-CN/docs/Web/JavaScript/Reference/Functions) +- [类](/zh-CN/docs/Web/JavaScript/Reference/Classes) - [`new`](/zh-CN/docs/Web/JavaScript/Reference/Operators/new) - [`this`](/zh-CN/docs/Web/JavaScript/Reference/Operators/this) diff --git a/files/zh-cn/web/javascript/reference/operators/spread_syntax/index.md b/files/zh-cn/web/javascript/reference/operators/spread_syntax/index.md index 6192d963e91631..2d37f761e1e3fc 100644 --- a/files/zh-cn/web/javascript/reference/operators/spread_syntax/index.md +++ b/files/zh-cn/web/javascript/reference/operators/spread_syntax/index.md @@ -223,6 +223,8 @@ var array = [...obj]; // TypeError: obj is not iterable {{Compat}} -## 相关链接 +## 参见 -- [剩余参数](/zh-CN/docs/Web/JavaScript/Reference/Functions/Rest_parameters)(Rest Parameters 也使用' `...` ') +- [剩余参数](/zh-CN/docs/Web/JavaScript/Reference/Functions/Rest_parameters) +- [剩余属性](/zh-CN/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#剩余属性) +- {{jsxref("Function.prototype.apply()")}} diff --git a/files/zh-cn/web/javascript/reference/operators/this/index.md b/files/zh-cn/web/javascript/reference/operators/this/index.md index b99f7cf54b1b78..19697bbc731d43 100644 --- a/files/zh-cn/web/javascript/reference/operators/this/index.md +++ b/files/zh-cn/web/javascript/reference/operators/this/index.md @@ -469,8 +469,7 @@ bird.sayBye(); // Bye from Ferrari {{Compat}} -## 相关链接 +## 参见 - [严格模式](/zh-CN/docs/Web/JavaScript/Reference/Strict_mode) -- [Gentle explanation of 'this' keyword in JavaScript](http://rainsoft.io/gentle-explanation-of-this-in-javascript/) -- Getting the global context: {{jsxref("globalThis")}} +- {{jsxref("globalThis")}} diff --git a/files/zh-cn/web/javascript/reference/operators/yield_star_/index.md b/files/zh-cn/web/javascript/reference/operators/yield_star_/index.md index bb92e9a459338d..c02cf849b8fe04 100644 --- a/files/zh-cn/web/javascript/reference/operators/yield_star_/index.md +++ b/files/zh-cn/web/javascript/reference/operators/yield_star_/index.md @@ -108,9 +108,9 @@ console.log(result); // "foo" {{Compat}} -## 相关链接 +## 参见 - [迭代器协议](/zh-CN/docs/Web/JavaScript/Guide/The_Iterator_protocol) - {{jsxref("Statements/function*", "function*")}} -- {{jsxref("Operators/function*", "function* expression")}} +- [`function*` 表达式](/zh-CN/docs/Web/JavaScript/Reference/Operators/function*) - {{jsxref("Operators/yield", "yield")}} diff --git a/files/zh-cn/web/javascript/reference/statements/block/index.md b/files/zh-cn/web/javascript/reference/statements/block/index.md index 28434a4903c14f..ba73bddb55b9b8 100644 --- a/files/zh-cn/web/javascript/reference/statements/block/index.md +++ b/files/zh-cn/web/javascript/reference/statements/block/index.md @@ -120,7 +120,7 @@ foo('outside'); // TypeError: foo is not a function {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Statements/while", "while")}} - {{jsxref("Statements/if...else", "if...else")}} diff --git a/files/zh-cn/web/javascript/reference/statements/break/index.md b/files/zh-cn/web/javascript/reference/statements/break/index.md index ad2bf564ed4a8b..4700c2aa6594a4 100644 --- a/files/zh-cn/web/javascript/reference/statements/break/index.md +++ b/files/zh-cn/web/javascript/reference/statements/break/index.md @@ -134,8 +134,8 @@ block_1: { {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Statements/continue", "continue")}} -- {{jsxref("Statements/label", "label")}} +- {{jsxref("Statements/label", "label", "", 1)}} - {{jsxref("Statements/switch", "switch")}} diff --git a/files/zh-cn/web/javascript/reference/statements/const/index.md b/files/zh-cn/web/javascript/reference/statements/const/index.md index 69941de14e6bac..978b3be4289d9e 100644 --- a/files/zh-cn/web/javascript/reference/statements/const/index.md +++ b/files/zh-cn/web/javascript/reference/statements/const/index.md @@ -119,8 +119,8 @@ MY_ARRAY = ["B"]; {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Statements/var", "var")}} - {{jsxref("Statements/let", "let")}} -- [Constants in the JavaScript Guide](/zh-CN/docs/Web/JavaScript/Guide/Grammar_and_types#Constants) +- [JavaScript 指南的常量](/zh-CN/docs/Web/JavaScript/Guide/Grammar_and_types#常量) diff --git a/files/zh-cn/web/javascript/reference/statements/do...while/index.md b/files/zh-cn/web/javascript/reference/statements/do...while/index.md index 4c42befcae435c..2d140ec04d86c6 100644 --- a/files/zh-cn/web/javascript/reference/statements/do...while/index.md +++ b/files/zh-cn/web/javascript/reference/statements/do...while/index.md @@ -56,7 +56,9 @@ document.getElementById("example").innerHTML = result; {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Statements/while", "while")}} - {{jsxref("Statements/for", "for")}} +- {{jsxref("Statements/break", "break")}} +- {{jsxref("Statements/continue", "continue")}} diff --git a/files/zh-cn/web/javascript/reference/statements/empty/index.md b/files/zh-cn/web/javascript/reference/statements/empty/index.md index af16fc789ed232..e8600ac9e269f5 100644 --- a/files/zh-cn/web/javascript/reference/statements/empty/index.md +++ b/files/zh-cn/web/javascript/reference/statements/empty/index.md @@ -61,6 +61,6 @@ else {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Statements/block", "块语句")}} diff --git a/files/zh-cn/web/javascript/reference/statements/for-await...of/index.md b/files/zh-cn/web/javascript/reference/statements/for-await...of/index.md index 1fccaebc50661b..57ec1e626603ef 100644 --- a/files/zh-cn/web/javascript/reference/statements/for-await...of/index.md +++ b/files/zh-cn/web/javascript/reference/statements/for-await...of/index.md @@ -122,7 +122,7 @@ getResponseSize("https://jsonplaceholder.typicode.com/photos"); {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Global_Objects/Symbol/asyncIterator", "Symbol.asyncIterator")}} - {{jsxref("Statements/for...of")}} diff --git a/files/zh-cn/web/javascript/reference/statements/for...in/index.md b/files/zh-cn/web/javascript/reference/statements/for...in/index.md index 81d174bd34ddf7..65344c27cab448 100644 --- a/files/zh-cn/web/javascript/reference/statements/for...in/index.md +++ b/files/zh-cn/web/javascript/reference/statements/for...in/index.md @@ -99,13 +99,11 @@ for (var i = 0 in obj) { 像其他引擎 V8(Chrome),Chakra (IE/Edge),JSC (WebKit/Safari) 正在研究去除这种不标准的行为。 -## 相关链接 +## 参见 - {{jsxref("Statements/for...of", "for...of")}} 一个类似的迭代属性值的语句 -- {{jsxref("Statements/for_each...in", "for each in")}} 一个类似的但是迭代的是对象的属性的值而不是其属性名字的语句(过时的) - {{jsxref("Statements/for", "for")}} -- 迭代器和构造器(uses the `for...in` syntax) - [属性的可枚举性和所有权](/zh-CN/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) - {{jsxref("Object.getOwnPropertyNames()")}} -- {{jsxref("Object.prototype.hasOwnProperty()")}} +- {{jsxref("Object.hasOwn()")}} - {{jsxref("Array.prototype.forEach()")}} diff --git a/files/zh-cn/web/javascript/reference/statements/for...of/index.md b/files/zh-cn/web/javascript/reference/statements/for...of/index.md index 1b779c999a30fb..ff007705dc0c79 100644 --- a/files/zh-cn/web/javascript/reference/statements/for...of/index.md +++ b/files/zh-cn/web/javascript/reference/statements/for...of/index.md @@ -303,7 +303,8 @@ for (let i of iterable) { {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Array.prototype.forEach()")}} - {{jsxref("Map.prototype.forEach()")}} +- {{jsxref("Object.entries()")}} diff --git a/files/zh-cn/web/javascript/reference/statements/function/index.md b/files/zh-cn/web/javascript/reference/statements/function/index.md index bf2c6c4c5ed314..bf957d6f853ede 100644 --- a/files/zh-cn/web/javascript/reference/statements/function/index.md +++ b/files/zh-cn/web/javascript/reference/statements/function/index.md @@ -134,11 +134,12 @@ function calc_sales(units_a, units_b, units_c) { {{Compat}} -## 相关链接 +## 参见 -- {{jsxref("Functions_and_function_scope", "Functions and function scope")}} +- [函数](/zh-CN/docs/Web/JavaScript/Guide/Functions)指南 +- [Function](/zh-CN/docs/Web/JavaScript/Reference/Functions) - {{jsxref("Function")}} -- {{jsxref("Operators/function", "function expression")}} -- {{jsxref("Statements/function*", "function* statement")}} -- {{jsxref("Operators/function*", "function* expression")}} -- {{jsxref("GeneratorFunction")}} +- [`function` 表达式](/zh-CN/docs/Web/JavaScript/Reference/Operators/function) +- {{jsxref("Statements/function*", "function*")}} +- {{jsxref("Statements/async_function", "async function")}} +- {{jsxref("Statements/async_function*", "async function*")}} diff --git a/files/zh-cn/web/javascript/reference/statements/function_star_/index.md b/files/zh-cn/web/javascript/reference/statements/function_star_/index.md index f1eba971b4bb20..faf6800e75d223 100644 --- a/files/zh-cn/web/javascript/reference/statements/function_star_/index.md +++ b/files/zh-cn/web/javascript/reference/statements/function_star_/index.md @@ -178,20 +178,21 @@ arr = [...gen]; // ["a", "b", "c", "d", "e"] {{Compat}} -## 相关链接 - -- {{jsxref("Operators/function*", "function* expression")}} -- {{jsxref("GeneratorFunction")}} object -- [迭代器协议](/zh-CN/docs/Web/JavaScript/Guide/The_Iterator_protocol) +## 参见 + +- [函数](/en-US/docs/Web/JavaScript/Guide/Functions)指南 +- [迭代器与生成器](/zh-CN/docs/Web/JavaScript/Guide/Iterators_and_generators)指南 +- [Function](/zh-CN/docs/Web/JavaScript/Reference/Functions) +- {{jsxref("GeneratorFunction")}} +- [`function*` 表达式](/zh-CN/docs/Web/JavaScript/Reference/Operators/function*) +- {{jsxref("Statements/function", "function")}} +- {{jsxref("Statements/async_function", "async function")}} +- {{jsxref("Statements/async_function*", "async function*")}} +- [迭代器协议](/zh-CN/docs/Web/JavaScript/Reference/Iteration_protocols) - {{jsxref("Operators/yield", "yield")}} - {{jsxref("Operators/yield*", "yield*")}} -- {{jsxref("Function")}} object -- {{jsxref("Statements/function", "function declaration")}} -- {{jsxref("Operators/function", "function expression")}} -- {{jsxref("Functions_and_function_scope", "Functions and function scope")}} -- 其他网络资源: - - - [Regenerator](http://facebook.github.io/regenerator/) an ES2015 generator compiler to ES5 - - [Forbes Lindesay: Promises and Generators: control flow utopia — JSConf EU 2013](http://www.youtube.com/watch?v=qbKWsbJ76-s) - - [Hemanth.HM: The New gen of \*gen(){}](https://www.youtube.com/watch?v=ZrgEZykBHVo&list=PLuoyIZT5fPlG44bPq50Wgh0INxykdrYX7&index=1) - - [Task.js](http://taskjs.org/) +- {{jsxref("Generator")}} +- GitHub 上的 [Regenerator](https://github.com/facebook/regenerator) +- [Promises and Generators: control flow utopia](https://youtu.be/qbKWsbJ76-s) presentation by Forbes Lindesay at JSConf (2013) +- [Task.js](https://github.com/mozilla/task.js) on GitHub +- [You Don't Know JS: Async & Performance, Ch.4: Generators](https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/async%20%26%20performance/ch4.md) by Kyle Simpson diff --git a/files/zh-cn/web/javascript/reference/statements/if...else/index.md b/files/zh-cn/web/javascript/reference/statements/if...else/index.md index 3cf9cfceb869fe..15de8d73d9094a 100644 --- a/files/zh-cn/web/javascript/reference/statements/if...else/index.md +++ b/files/zh-cn/web/javascript/reference/statements/if...else/index.md @@ -124,8 +124,8 @@ if ((x = y)) { {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Statements/block", "block")}} - {{jsxref("Statements/switch", "switch")}} -- {{jsxref("Operators/conditional_operator", "条件运算符")}} +- [条件(三元)运算符](/zh-CN/docs/Web/JavaScript/Reference/Operators/Conditional_operator) diff --git a/files/zh-cn/web/javascript/reference/statements/import/index.md b/files/zh-cn/web/javascript/reference/statements/import/index.md index 23ac74edaffb1a..115c86e4aba7ec 100644 --- a/files/zh-cn/web/javascript/reference/statements/import/index.md +++ b/files/zh-cn/web/javascript/reference/statements/import/index.md @@ -227,12 +227,13 @@ for (const link of document.querySelectorAll("nav > a")) { {{Compat}} -## 相关链接 - -- {{JSxRef("Statements/export", "export")}} -- [`import.meta`](/zh-CN/docs/Web/JavaScript/Reference/Statements/import.meta) -- Limin Zhu, Brian Terlson and Microsoft Edge Team: [Previewing ES6 Modules and more from ES2015, ES2016 and beyond](https://blogs.windows.com/msedgedev/2016/05/17/es6-modules-and-beyond/) -- Hacks blog post by Jason Orendorff: [ES6 in Depth: Modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/) -- Hacks blog post by Lin Clark: [ES modules: A cartoon deep-dive](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/) -- Axel Rauschmayer's book: ["Exploring JS: Modules"](https://exploringjs.com/es6/ch_modules.html) -- The Modern JavaScript Tutorial(javascript.info): [Export and Import](https://javascript.info/import-export) +## 参见 + +- {{jsxref("Statements/export", "export")}} +- [`import()`](/zh-CN/docs/Web/JavaScript/Reference/Operators/import) +- [`import.meta`](/zh-CN/docs/Web/JavaScript/Reference/Operators/import.meta) +- [预览 ES6 模块以及 ES2015、ES2016 和更多内容](https://blogs.windows.com/msedgedev/2016/05/17/es6-modules-and-beyond/),载于 blogs.windows.com (2016) +- [ES6 深入浅出:模块](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/),载于 hacks.mozilla.org (2015) +- [深入挖掘 ES 模块](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/),载于 hacks.mozilla.org (2018) +- [探索 JS,第 16 章:模块](https://exploringjs.com/es6/ch_modules.html),由 Dr. Axel Rauschmayer 撰写 +- [Export 和 Import](https://javascript.info/import-export),载于 javascript.info diff --git a/files/zh-cn/web/javascript/reference/statements/switch/index.md b/files/zh-cn/web/javascript/reference/statements/switch/index.md index 13cd5686bdca3e..47552c025f3430 100644 --- a/files/zh-cn/web/javascript/reference/statements/switch/index.md +++ b/files/zh-cn/web/javascript/reference/statements/switch/index.md @@ -251,6 +251,6 @@ switch (action) { {{Compat}} -## 相关链接 +## 参见 -- [`if...else`](/zh-CN/docs/Web/JavaScript/Reference/Statements/if...else) +- {{jsxref("Statements/if...else", "if...else")}} diff --git a/files/zh-cn/web/javascript/reference/statements/throw/index.md b/files/zh-cn/web/javascript/reference/statements/throw/index.md index dc2306ef255517..1e043f5edd131b 100644 --- a/files/zh-cn/web/javascript/reference/statements/throw/index.md +++ b/files/zh-cn/web/javascript/reference/statements/throw/index.md @@ -168,6 +168,7 @@ try { {{Compat}} -## 相关链接 +## 参见 -- [`try...catch`](/zh-CN/docs/Web/JavaScript/Reference/Statements/try...catch) +- {{jsxref("Statements/try...catch", "try...catch")}} +- {{jsxref("Error")}} diff --git a/files/zh-cn/web/javascript/reference/statements/try...catch/index.md b/files/zh-cn/web/javascript/reference/statements/try...catch/index.md index 8ef1c8dcb102e7..b8a5bf7c2b1ecf 100644 --- a/files/zh-cn/web/javascript/reference/statements/try...catch/index.md +++ b/files/zh-cn/web/javascript/reference/statements/try...catch/index.md @@ -242,7 +242,7 @@ try { {{Compat}} -## 相关链接 +## 参见 - {{jsxref("Error")}} - {{jsxref("Statements/throw", "throw")}} diff --git a/files/zh-cn/web/javascript/reference/strict_mode/index.md b/files/zh-cn/web/javascript/reference/strict_mode/index.md index 54938249fe6cc2..af3e5c78b093ab 100644 --- a/files/zh-cn/web/javascript/reference/strict_mode/index.md +++ b/files/zh-cn/web/javascript/reference/strict_mode/index.md @@ -349,13 +349,7 @@ function baz() { 主流浏览器现在实现了严格模式。但是不要盲目地依赖它,因为市场上仍然有大量的浏览器版本只部分支持严格模式或者根本就不支持(比如 IE10 之前的版本)。*严格模式改变了语义。*依赖这些改变可能会导致没有实现严格模式的浏览器中出现问题或者错误。谨慎地使用严格模式,通过检测相关代码的功能保证严格模式不出问题。最后,记得*在支持或者不支持严格模式的浏览器中测试你的代码*。如果你只在不支持严格模式的浏览器中测试,那么在支持的浏览器中就很有可能出问题,反之亦然。 -## 相关链接 - -- [Where's Walden? » New ES5 strict mode support: now with poison pills!](http://whereswalden.com/2010/09/08/new-es5-strict-mode-support-now-with-poison-pills/) -- [Where's Walden? » New ES5 strict mode requirement: function statements not at top level of a program or function are prohibited](http://whereswalden.com/2011/01/24/new-es5-strict-mode-requirement-function-statements-not-at-top-level-of-a-program-or-function-are-prohibited/) -- [Where's Walden? » New ES5 strict mode support: new vars created by strict mode eval code are local to that code only](http://whereswalden.com/2011/01/10/new-es5-strict-mode-support-new-vars-created-by-strict-mode-eval-code-are-local-to-that-code-only/) -- [JavaScript "use strict" tutorial for beginners.](http://qnimate.com/javascript-strict-mode-in-nutshell/) -- [John Resig - ECMAScript 5 Strict Mode, JSON, and More](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/) -- [ECMA-262-5 in detail. Chapter 2. Strict Mode.](http://dmitrysoshnikov.com/ecmascript/es5-chapter-2-strict-mode/) -- [Strict mode compatibility table](http://kangax.github.com/es5-compat-table/strict-mode/) -- [Transitioning to strict mode](/zh-CN/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode) +## 参见 + +- [JavaScript 模块](/zh-CN/docs/Web/JavaScript/Guide/Modules)指南 +- [词法语法](/zh-CN/docs/Web/JavaScript/Reference/Lexical_grammar) From f67910f2cc33f184de244e4e2a92b519268019c8 Mon Sep 17 00:00:00 2001 From: A1lo Date: Tue, 31 Oct 2023 13:21:32 +0800 Subject: [PATCH 2/4] Update files/zh-cn/web/javascript/reference/statements/function_star_/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../web/javascript/reference/statements/function_star_/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/zh-cn/web/javascript/reference/statements/function_star_/index.md b/files/zh-cn/web/javascript/reference/statements/function_star_/index.md index faf6800e75d223..f95eac40a46010 100644 --- a/files/zh-cn/web/javascript/reference/statements/function_star_/index.md +++ b/files/zh-cn/web/javascript/reference/statements/function_star_/index.md @@ -180,7 +180,7 @@ arr = [...gen]; // ["a", "b", "c", "d", "e"] ## 参见 -- [函数](/en-US/docs/Web/JavaScript/Guide/Functions)指南 +- [函数](/zh-CN/docs/Web/JavaScript/Guide/Functions)指南 - [迭代器与生成器](/zh-CN/docs/Web/JavaScript/Guide/Iterators_and_generators)指南 - [Function](/zh-CN/docs/Web/JavaScript/Reference/Functions) - {{jsxref("GeneratorFunction")}} From ee7c6046e41d4b987ae0364ba18487ec7f95c7ff Mon Sep 17 00:00:00 2001 From: Jason Ren <40999116+jasonren0403@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:29:04 +0800 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: A1lo --- files/zh-cn/web/api/cssstylerule/style/index.md | 2 +- files/zh-cn/web/api/screen/colordepth/index.md | 2 +- .../web/javascript/reference/operators/function/index.md | 2 +- .../web/javascript/reference/statements/const/index.md | 2 +- .../javascript/reference/statements/function_star_/index.md | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/files/zh-cn/web/api/cssstylerule/style/index.md b/files/zh-cn/web/api/cssstylerule/style/index.md index 4fc1476ad06b63..6487b38a54757d 100644 --- a/files/zh-cn/web/api/cssstylerule/style/index.md +++ b/files/zh-cn/web/api/cssstylerule/style/index.md @@ -13,7 +13,7 @@ slug: Web/API/CSSStyleRule/style styleObj = cssRule.style ``` -## 例子 +## 示例 ```js function stilo() { diff --git a/files/zh-cn/web/api/screen/colordepth/index.md b/files/zh-cn/web/api/screen/colordepth/index.md index e4ff03d4452bc7..0494399b9171d4 100644 --- a/files/zh-cn/web/api/screen/colordepth/index.md +++ b/files/zh-cn/web/api/screen/colordepth/index.md @@ -11,7 +11,7 @@ slug: Web/API/Screen/colorDepth ```js // 检测屏幕的颜色深度 -if ( window.screen.colorDepth < 8) { +if (window.screen.colorDepth < 8) { // 使用低色彩版本页面 } else { // 使用常规的彩色版页面 diff --git a/files/zh-cn/web/javascript/reference/operators/function/index.md b/files/zh-cn/web/javascript/reference/operators/function/index.md index f489300a4e225f..e6a3ac5b47bcd9 100644 --- a/files/zh-cn/web/javascript/reference/operators/function/index.md +++ b/files/zh-cn/web/javascript/reference/operators/function/index.md @@ -105,4 +105,4 @@ button.addEventListener("click", function (event) { - {{jsxref("Functions/Arrow_functions", "箭头函数", "", 1)}} - {{jsxref("Functions", "函数", "", 1)}} - {{jsxref("Function")}} -- {{jsxref("Statements/function", "function 语句")}} +- {{jsxref("Statements/function", "function 语句", "", 1)}} diff --git a/files/zh-cn/web/javascript/reference/statements/const/index.md b/files/zh-cn/web/javascript/reference/statements/const/index.md index 978b3be4289d9e..1874f032d2a842 100644 --- a/files/zh-cn/web/javascript/reference/statements/const/index.md +++ b/files/zh-cn/web/javascript/reference/statements/const/index.md @@ -123,4 +123,4 @@ MY_ARRAY = ["B"]; - {{jsxref("Statements/var", "var")}} - {{jsxref("Statements/let", "let")}} -- [JavaScript 指南的常量](/zh-CN/docs/Web/JavaScript/Guide/Grammar_and_types#常量) +- [JavaScript 指南中的常量](/zh-CN/docs/Web/JavaScript/Guide/Grammar_and_types#常量) diff --git a/files/zh-cn/web/javascript/reference/statements/function_star_/index.md b/files/zh-cn/web/javascript/reference/statements/function_star_/index.md index f95eac40a46010..aa7465de23d4b3 100644 --- a/files/zh-cn/web/javascript/reference/statements/function_star_/index.md +++ b/files/zh-cn/web/javascript/reference/statements/function_star_/index.md @@ -193,6 +193,6 @@ arr = [...gen]; // ["a", "b", "c", "d", "e"] - {{jsxref("Operators/yield*", "yield*")}} - {{jsxref("Generator")}} - GitHub 上的 [Regenerator](https://github.com/facebook/regenerator) -- [Promises and Generators: control flow utopia](https://youtu.be/qbKWsbJ76-s) presentation by Forbes Lindesay at JSConf (2013) -- [Task.js](https://github.com/mozilla/task.js) on GitHub -- [You Don't Know JS: Async & Performance, Ch.4: Generators](https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/async%20%26%20performance/ch4.md) by Kyle Simpson +- [Promise 和生成器:控制流的乌托邦](https://youtu.be/qbKWsbJ76-s)——Forbes Lindesay 在 JSConf 上的演讲(2013) +- GitHub 上的 [Task.js](https://github.com/mozilla/task.js) +- [你不知道的 JS:异步和性能,第 4 章:生成器](https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/async%20%26%20performance/ch4.md)——Kyle Simpson From 7dd7906f6fa2c96b9c7e18a945f0b17668f1d224 Mon Sep 17 00:00:00 2001 From: Jason Ren <40999116+jasonren0403@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:33:17 +0800 Subject: [PATCH 4/4] fix lint --- files/zh-cn/web/api/cssstylerule/style/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/files/zh-cn/web/api/cssstylerule/style/index.md b/files/zh-cn/web/api/cssstylerule/style/index.md index 6487b38a54757d..5aa7af3561e844 100644 --- a/files/zh-cn/web/api/cssstylerule/style/index.md +++ b/files/zh-cn/web/api/cssstylerule/style/index.md @@ -26,7 +26,6 @@ function stilo() { declaration block 是样式规则中花括号内的部分(选择器就在花括号的外部) - ## 规范 {{Specifications}}