From c67a2b426b1690f7271872a8760814699f1b3661 Mon Sep 17 00:00:00 2001 From: MDN Web Docs GitHub Bot <108879845+mdn-bot@users.noreply.github.com> Date: Tue, 27 Aug 2024 06:22:54 +0200 Subject: [PATCH] [zh-cn] sync translated content (#23276) * zh-cn: sync translated content * Move URL related docs to the new area ref: mdn/content#35202 --------- Co-authored-by: allo --- files/zh-cn/_redirects.txt | 12 +- files/zh-cn/_wikihistory.json | 64 ++++------- files/zh-cn/glossary/base64/index.md | 6 +- .../web_mechanics/what_is_a_url/index.md | 4 +- .../api/document/fragmentdirective/index.md | 2 +- .../web/api/filereader/readasdataurl/index.md | 2 +- .../zh-cn/web/api/fragmentdirective/index.md | 2 +- .../api/htmlcanvaselement/todataurl/index.md | 6 +- files/zh-cn/web/api/window/atob/index.md | 2 +- files/zh-cn/web/api/window/btoa/index.md | 2 +- .../web/api/workerglobalscope/atob/index.md | 2 +- .../web/api/workerglobalscope/btoa/index.md | 2 +- .../web/css/_doublecolon_target-text/index.md | 4 +- files/zh-cn/web/html/element/a/index.md | 6 +- .../web/html/global_attributes/id/index.md | 6 +- .../identifying_resources_on_the_web/index.md | 108 ------------------ files/zh-cn/web/http/basics_of_http/index.md | 12 +- files/zh-cn/web/http/headers/alt-svc/index.md | 22 ++-- .../web/http/resources_and_uris/index.md | 21 ---- files/zh-cn/web/http/session/index.md | 4 +- .../index.md | 4 +- .../fragment}/text_fragments/index.md | 4 +- .../data_urls => uri/schemes/data}/index.md | 4 +- 23 files changed, 81 insertions(+), 220 deletions(-) delete mode 100644 files/zh-cn/web/http/basics_of_http/identifying_resources_on_the_web/index.md delete mode 100644 files/zh-cn/web/http/resources_and_uris/index.md rename files/zh-cn/web/{http/basics_of_http => uri/authority}/choosing_between_www_and_non-www_urls/index.md (97%) rename files/zh-cn/web/{ => uri/fragment}/text_fragments/index.md (99%) rename files/zh-cn/web/{http/basics_of_http/data_urls => uri/schemes/data}/index.md (98%) diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 614b439ae517cf..e869965ccb9dc5 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -2423,9 +2423,11 @@ /zh-CN/docs/Web/HTML/动作 /zh-CN/docs/Glossary/Speculative_parsing /zh-CN/docs/Web/HTML/属性 /zh-CN/docs/Web/HTML/Attributes /zh-CN/docs/Web/HTTP/Access_control_CORS /zh-CN/docs/Web/HTTP/CORS -/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URIs /zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URLs +/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs /zh-CN/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs +/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URIs /zh-CN/docs/Web/URI/Schemes/data +/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URLs /zh-CN/docs/Web/URI/Schemes/data /zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types /zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types -/zh-CN/docs/Web/HTTP/Basics_of_HTTP/选择_www_或非_www_URL_作为域名 /zh-CN/docs/Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs +/zh-CN/docs/Web/HTTP/Basics_of_HTTP/选择_www_或非_www_URL_作为域名 /zh-CN/docs/Web/URI/Authority/Choosing_between_www_and_non-www_URLs /zh-CN/docs/Web/HTTP/CORS/Errors/CORS错误允许凭证 /zh-CN/docs/Web/HTTP/CORS/Errors/CORSMIssingAllowCredentials /zh-CN/docs/Web/HTTP/Caching_FAQ /zh-CN/docs/Web/HTTP/Caching /zh-CN/docs/Web/HTTP/Content_negotiation/Accept_默认值 /zh-CN/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values @@ -2460,12 +2462,13 @@ /zh-CN/docs/Web/HTTP/Link_prefetching_FAQ /zh-CN/docs/Glossary/Prefetch /zh-CN/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file /zh-CN/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file /zh-CN/docs/Web/HTTP/Public_Key_Pinning /zh-CN/docs/Web/Security/Certificate_Transparency +/zh-CN/docs/Web/HTTP/Resources_and_URIs /zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types /zh-CN/docs/Web/HTTP/Response_codes /zh-CN/docs/Web/HTTP/Status /zh-CN/docs/Web/HTTP/Response_codes/100 /zh-CN/docs/Web/HTTP/Status/100 /zh-CN/docs/Web/HTTP/Response_codes/204 /zh-CN/docs/Web/HTTP/Status/204 /zh-CN/docs/Web/HTTP/Response_codes/501 /zh-CN/docs/Web/HTTP/Status/501 /zh-CN/docs/Web/HTTP/X-Frame-Options /zh-CN/docs/Web/HTTP/Headers/X-Frame-Options -/zh-CN/docs/Web/HTTP/data_URIs /zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URLs +/zh-CN/docs/Web/HTTP/data_URIs /zh-CN/docs/Web/URI/Schemes/data /zh-CN/docs/Web/HTTP/消息 /zh-CN/docs/Web/HTTP/Messages /zh-CN/docs/Web/HTTP/策略特征 /zh-CN/docs/Web/HTTP/Permissions_Policy /zh-CN/docs/Web/HTTP/缓存_FAQ /zh-CN/docs/Web/HTTP/Caching @@ -2754,6 +2757,7 @@ /zh-CN/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion /zh-CN/docs/Web/Security/Practical_implementation_guides/Turning_off_form_autocompletion /zh-CN/docs/Web/Security/传输层安全协议 /zh-CN/docs/Web/Security/Transport_Layer_Security /zh-CN/docs/Web/Security/子资源完整性 /zh-CN/docs/Web/Security/Subresource_Integrity +/zh-CN/docs/Web/Text_fragments /zh-CN/docs/Web/URI/Fragment/Text_fragments /zh-CN/docs/Web/WEB_API_---js /zh-CN/docs/Web/API /zh-CN/docs/Web/WebGL /zh-CN/docs/Web/API/WebGL_API /zh-CN/docs/Web/WebGL/Adding_2D_content_to_a_WebGL_context /zh-CN/docs/Web/API/WebGL_API/Tutorial/Adding_2D_content_to_a_WebGL_context @@ -2792,7 +2796,7 @@ /zh-CN/docs/XPath-840092-dup /zh-CN/docs/Web/XPath /zh-CN/docs/XSLT /zh-CN/docs/Web/XSLT /zh-CN/docs/d_temp /zh-CN/docs/Web/API/Document -/zh-CN/docs/data_URIs /zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URLs +/zh-CN/docs/data_URIs /zh-CN/docs/Web/URI/Schemes/data /zh-CN/docs/en /en-US/ /zh-CN/docs/keypress /zh-CN/docs/Web/API/Element/keypress_event /zh-CN/docs/learn/Accessibility/CSS和JavaScript /zh-CN/docs/Learn/Accessibility/CSS_and_JavaScript diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 5a5cb7fd2679d1..7b682c372eb916 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -22387,30 +22387,6 @@ "cissoid" ] }, - "Web/HTTP/Basics_of_HTTP/Choosing_between_www_and_non-www_URLs": { - "modified": "2019-03-23T22:18:43.282Z", - "contributors": [ - "zqyue", - "Ende93", - "xgqfrms-GitHub", - "ziyunfei", - "chaos_zhang" - ] - }, - "Web/HTTP/Basics_of_HTTP/Data_URLs": { - "modified": "2020-10-15T21:06:54.948Z", - "contributors": [ - "leegent", - "2585479524", - "BobGreen", - "bramblex", - "tlos142857", - "Ende93", - "xgqfrms-GitHub", - "little-tomorrow", - "ziyunfei" - ] - }, "Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP": { "modified": "2020-02-20T03:41:08.272Z", "contributors": [ @@ -22428,18 +22404,6 @@ "WeijieZhu" ] }, - "Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web": { - "modified": "2019-05-06T05:35:10.899Z", - "contributors": [ - "wolfzZ", - "heyv5", - "springapple", - "Wendy_Love", - "yuankunzhang", - "little-tomorrow", - "DreamerKing" - ] - }, "Web/HTTP/Basics_of_HTTP/MIME_types": { "modified": "2020-11-04T00:16:29.009Z", "contributors": [ @@ -23413,10 +23377,6 @@ "ZhongyiChen" ] }, - "Web/HTTP/Resources_and_URIs": { - "modified": "2019-09-05T00:27:21.660Z", - "contributors": ["ran"] - }, "Web/HTTP/Resources_and_specifications": { "modified": "2019-03-23T22:14:32.179Z", "contributors": ["ppphp", "shevacjs", "yuankunzhang"] @@ -32360,6 +32320,30 @@ "ziyunfei" ] }, + "Web/URI/Authority/Choosing_between_www_and_non-www_URLs": { + "modified": "2019-03-23T22:18:43.282Z", + "contributors": [ + "zqyue", + "Ende93", + "xgqfrms-GitHub", + "ziyunfei", + "chaos_zhang" + ] + }, + "Web/URI/Schemes/data": { + "modified": "2020-10-15T21:06:54.948Z", + "contributors": [ + "leegent", + "2585479524", + "BobGreen", + "bramblex", + "tlos142857", + "Ende93", + "xgqfrms-GitHub", + "little-tomorrow", + "ziyunfei" + ] + }, "Web/WebDriver": { "modified": "2020-10-15T22:20:19.059Z", "contributors": ["lvbaiying", "ZQ-jhon"] diff --git a/files/zh-cn/glossary/base64/index.md b/files/zh-cn/glossary/base64/index.md index 53b322e576b1e4..0d3c8e87928d99 100644 --- a/files/zh-cn/glossary/base64/index.md +++ b/files/zh-cn/glossary/base64/index.md @@ -15,13 +15,13 @@ l10n: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ ``` -一种常见的变体是“URL 安全的 Base64”,它省略了填充,并将 `+/` 替换为 `-_`,以避免在 {{glossary("URL")}} 路径段或查询参数中可能引起问题的字符的问题。如果不将数据放在路径段或查询参数中,你就不需要用到这一变体。例如,[data URL](/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) 既没有路径段也没有查询参数,因此可以使用标准的 Base64 编码。 +一种常见的变体是“URL 安全的 Base64”,它省略了填充,并将 `+/` 替换为 `-_`,以避免在 {{glossary("URL")}} 路径段或查询参数中可能引起问题的字符的问题。如果不将数据放在路径段或查询参数中,你就不需要用到这一变体。例如,[data URL](/zh-CN/docs/Web/URI/Schemes/data) 既没有路径段也没有查询参数,因此可以使用标准的 Base64 编码。 Base64 编码方案通常用于对二进制数据进行编码,以便在只能处理 ASCII 文本(或某些 ASCII 的超集,仍不接受任意二进制数据)的媒体上进行存储或传输。这确保了数据在传输过程中保持不变。Base64 的常见应用包括: - 通过[多用途互联网邮件扩展](https://zh.wikipedia.org/wiki/多用途互聯網郵件擴展)发送电子邮件 - 在 [XML](/zh-CN/docs/Web/XML) 中存储复杂数据 -- 编码二进制数据以便包含在 [`data:` URL](/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) 中 +- 编码二进制数据以便包含在 [`data:` URL](/zh-CN/docs/Web/URI/Schemes/data) 中 ## 编码后大小增加 @@ -97,6 +97,6 @@ await dataUrlToBytes("data:application/octet-stream;base64,AAEC"); // Uint8Array - JavaScript API: - {{domxref("Window.btoa()")}}(也在 {{domxref("WorkerGlobalScope.btoa()", "worker 中可用", "", 1)}}) - {{domxref("Window.atob()")}}(也在 {{domxref("WorkerGlobalScope.atob()", "worker 中可用", "", 1)}}) -- [Data URL](/zh-CN/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) +- [Data URL](/zh-CN/docs/Web/URI/Schemes/data) - 维基百科上的 [Base64](https://zh.wikipedia.org/wiki/Base64) - [RFC 4648](https://datatracker.ietf.org/doc/html/rfc4648) 中对 Base64 算法的描述 diff --git a/files/zh-cn/learn/common_questions/web_mechanics/what_is_a_url/index.md b/files/zh-cn/learn/common_questions/web_mechanics/what_is_a_url/index.md index 0275ca3a237d42..6c8bb71659f0cc 100644 --- a/files/zh-cn/learn/common_questions/web_mechanics/what_is_a_url/index.md +++ b/files/zh-cn/learn/common_questions/web_mechanics/what_is_a_url/index.md @@ -109,7 +109,7 @@ URL 的第一部分是*方案*(scheme),它表示浏览器必须使用的 - 显示其他 HTML 文档,用 {{HTMLElement("iframe")}} 元素。 > [!NOTE] -> 当在页面中加载资源时指定 URL(例如使用 `