-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mdn:main' into translate
- Loading branch information
Showing
49 changed files
with
1,362 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ssing_semicolon_before_statement/index.md → ...eference/errors/unexpected_token/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
.../reference/errors/undefined_prop/index.md → .../reference/errors/undefined_prop/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...eference/errors/deprecated_octal/index.md → .../errors/deprecated_octal_literal/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: 粘性激活 | ||
slug: Glossary/Sticky_activation | ||
l10n: | ||
sourceCommit: ada5fa5ef15eadd44b549ecf906423b4a2092f34 | ||
--- | ||
|
||
{{GlossarySidebar}} | ||
|
||
**粘性激活**(或“粘性用户激活”)是一种表示用户按下了按钮、移动了鼠标、使用了菜单或执行了其他用户交互窗口状态。 | ||
|
||
如果用户当前正在与页面交互或自页面加载以来完成了触摸、指针或键盘交互,则该页面被视为“用户已激活”。如果某个页面被设置了黏性激活状态,则在会话期间不会该状态被重置(与{{Glossary("Transient activation", "瞬态激活")}}不同)。 | ||
|
||
参见[由用户激活控制的特性](/zh-CN/docs/Web/Security/User_activation)以查看需要*粘性激活*的 API 示例。 | ||
|
||
参见 {{domxref("UserActivation.hasBeenActive")}} 属性以通过编程方式获取当前窗口的粘性激活状态。 | ||
|
||
## 参见 | ||
|
||
- [HTML 动态标准 > 黏性激活](https://html.spec.whatwg.org/multipage/interaction.html#sticky-activation) | ||
- {{Glossary("Transient activation", "瞬态激活")}} | ||
- {{domxref("UserActivation.hasBeenActive")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: 样式表 | ||
slug: Glossary/Stylesheet | ||
l10n: | ||
sourceCommit: ada5fa5ef15eadd44b549ecf906423b4a2092f34 | ||
--- | ||
|
||
{{GlossarySidebar}} | ||
|
||
**样式表**是一组用于控制网页或文档布局和设计的 CSS 规则。*内部*样式表放置在网页文档的 {{htmlelement("head")}} 中的 {{htmlelement("style")}} 元素内,而*外部*样式表则放置在单独的 `.css` 文件中,并通过在文档头部的 {{htmlelement("link")}} 元素引用外部样式表文件的方法来将其应用于文档。 | ||
|
||
通常推荐使用外部样式表,因为这允许你在一个地方控制多个页面的样式,而无需在每个页面上重复 CSS。 | ||
|
||
## 参见 | ||
|
||
- [CSS 入门](/zh-CN/docs/Learn/CSS/First_steps) | ||
- 维基百科上的[样式表](https://zh.wikipedia.org/wiki/样式表) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: 提交按钮 | ||
slug: Glossary/Submit_button | ||
l10n: | ||
sourceCommit: c9a87fc4010cef73c21c5f46662431f3c8ad2d28 | ||
--- | ||
|
||
{{GlossarySidebar}} | ||
|
||
**提交按钮**是一种可用于提交{{HTMLElement("form", "表单")}}的 HTML {{Glossary("element", "元素")}}。原生的提交按钮元素包括: | ||
|
||
- {{HtmlElement("button")}}(其默认 `type` 为 `"submit"`) | ||
- {{HtmlElement('input/submit', '<input type="submit">')}} | ||
- {{HtmlElement('input/image', '<input type="image">')}} | ||
|
||
除了提交表单,提交按钮还可以影响表单的行为和发送的数据。 | ||
|
||
## 重写表单的行为 | ||
|
||
提交按钮可以通过各种属性重写表单的提交行为: | ||
|
||
- `{{HtmlElement("button#formaction", "formaction")}}`:覆盖表单的 [`action`](/zh-CN/docs/Web/HTML/Element/form#action) 属性。 | ||
- `{{HtmlElement("button#formenctype", "formenctype")}}`:覆盖表单的 [`enctype`](/zh-CN/docs/Web/HTML/Element/form#enctype) 属性。 | ||
- `{{HtmlElement("button#formmethod", "formmethod")}}`:覆盖表单的 [`method`](/zh-CN/docs/Web/HTML/Element/form#method) 属性。 | ||
- `{{HtmlElement("button#formnovalidate", "formnovalidate")}}`:覆盖表单的 [`novalidate`](/zh-CN/docs/Web/HTML/Element/form#novalidate) 属性。 | ||
- `{{HtmlElement("button#formtarget", "formtarget")}}`:覆盖表单的 [`target`](/zh-CN/docs/Web/HTML/Element/form#target) 属性。 | ||
|
||
## 表单数据条目 | ||
|
||
如果提交按钮是 {{HtmlElement("button")}} 或 {{HtmlElement('input/submit', '<input type="submit">')}} 并且具有 `name` 属性,表单数据集将包括其 `name` 和 `value` 的条目。 | ||
|
||
如果提交按钮是 {{HtmlElement('input/image', '<input type="image">')}},表单数据集将包括用户点击的 X、Y 坐标的条目(如 `x=100&y=200` 或 `buttonName.x=123&buttonName.y=234`)。 | ||
|
||
## 参见 | ||
|
||
- [基本的原生表单控件](/zh-CN/docs/Learn/Forms/Basic_native_form_controls) | ||
- [发送表单数据](/zh-CN/docs/Learn/Forms/Sending_and_retrieving_form_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
--- | ||
title: Synchronous(同步) | ||
title: 同步 | ||
slug: Glossary/Synchronous | ||
l10n: | ||
sourceCommit: 50e5e8a9b8a6b7d0dd9877610c9639d8b90f329f | ||
--- | ||
|
||
{{GlossarySidebar}} | ||
|
||
各方都实时(或者尽可能实时)地收取(而且必要的话也处理或者回复)信息的即时沟通方式,即为**同步**。 | ||
**同步**指的是各方都实时(或者尽可能实时)地收取(而且必要的话也处理或者回复)信息的即时沟通方式。 | ||
|
||
电话即为一个日常的例子:人们都倾向于在使用电话时即时地作出回应。 | ||
比较常见的一个例子是电话:人们都倾向于在使用电话时即时地作出回应。 | ||
|
||
许多程序指令也是实时的:例如当输入一个算式时,除非编程人员有意为止,否则环境都会**立即**将结果反馈回来。 | ||
许多程序指令也是实时的:例如当输入一个算式时,除非编程人员有意为止,否则环境都会立即将结果反馈回来。 | ||
|
||
## 参见 | ||
|
||
- {{glossary("Asynchronous")}} | ||
- 使用了 [XMLHttpRequest()](/zh-CN/docs/Web/API/XMLHttpRequest) {{glossary("API")}} 的[同步和异步请求](/zh-CN/docs/Web/API/XMLHttpRequest_API/Synchronous_and_Asynchronous_Requests) | ||
- 相关术语: | ||
- {{glossary("Asynchronous", "异步")}} | ||
- [异步 JavaScript](/zh-CN/docs/Learn/JavaScript/Asynchronous) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: 语法 | ||
slug: Glossary/Syntax | ||
l10n: | ||
sourceCommit: ada5fa5ef15eadd44b549ecf906423b4a2092f34 | ||
--- | ||
|
||
{{GlossarySidebar}} | ||
|
||
语法指定了组成正确结构代码所需的{{Glossary("character", "字符")}}的组合和顺序。语法通常包括语法规则和适用于书写的规则,例如 Python 中的缩进要求。 | ||
|
||
语法因语言而异(例如,{{Glossary("HTML")}} 和 {{Glossary("JavaScript")}} 的语法不同)。尽管语言在语法方面可能有一些相似之处,比如 JavaScript 和 Python 语言都有一条“操作数 运算符 操作数”语法规则,但这并不意味着两种语言的语法相似。 | ||
|
||
语法既适用于编程语言(对计算机的命令),也适用于标记语言(文档结构信息)。 | ||
|
||
语法只管顺序和结构;指令还必须*有意义*,这就是{{Glossary("semantics", "语义")}}的范畴。 | ||
|
||
代码必须符合正确的语法才能正确{{Glossary("compile", "编译")}},否则会出现{{Glossary("syntax error", "语法错误")}}。即使是小错误,比如缺少一个括号,也会导致源代码无法成功编译。 | ||
|
||
如果框架具有“干净”的语法,则表示它们生成简单、可读、简洁的结果。如果代码库使用“很多语法”,则意味着它需要更多字符来实现相同的功能。 | ||
|
||
## 参见 | ||
|
||
- 维基百科上的[语法](<https://en.wikipedia.org/wiki/Syntax_(programming_languages)>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: TLD | ||
slug: Glossary/TLD | ||
l10n: | ||
sourceCommit: ada5fa5ef15eadd44b549ecf906423b4a2092f34 | ||
--- | ||
|
||
{{GlossarySidebar}} | ||
|
||
TLD(_顶级域_)是在互联网的层次结构 DNS(域名系统)中最通用的 {{Glossary("domain", "域名")}}。TLD 是{{Glossary("domain name", "域名")}}的最后一个组成部分,例如,`developer.mozilla.org` 中的 `org`。 | ||
|
||
{{Glossary("ICANN")}}(互联网名称与数字地址分配机构)指定组织来管理每个 TLD。根据管理组织可能有多严格,TLD 通常作为网站的用途、所有权或国籍的线索。 | ||
|
||
考虑一个示例的互联网地址:`https://developer.mozilla.org`。这里的 org 是 TLD;mozilla.org 是二级域名;developer 是子域名。所有这些组成了一个完全限定域名;添加 https\:// 使其成为一个完整的 URL。 | ||
|
||
{{Glossary("IANA")}} 今天区分以下顶级域组: | ||
|
||
- 国家代码顶级域(ccTLD) | ||
- : 为国家或地区建立的两个字符域。例如:美国的 _.us_。 | ||
- 国际化国家代码顶级域(IDN ccTLD) | ||
- : 非拉丁字符集(例如阿拉伯语或中文)的 ccTLD。 | ||
- 通用顶级域(gTLD) | ||
- : 具有三个或更多字符的顶级域。 | ||
- 无赞助顶级域 | ||
- : 直接根据 ICANN 为全球互联网社区建立的政策运作的域,例如“com”和“:edu”。 | ||
- 赞助顶级域(sTLD) | ||
- : 这些域由私人组织提出并赞助,根据社区主题概念决定申请者是否有资格使用 TLD。 | ||
- 基础设施顶级域 | ||
- : 这个组由单个域——{{Glossary("ARPA", "地址和路由参数区")}}(ARPA)——组成。 | ||
|
||
## 参见 | ||
|
||
- 维基百科上的 [TLD](https://zh.wikipedia.org/wiki/頂級域) | ||
- [顶级域的列表](https://www.iana.org/domains/root/db) |
Oops, something went wrong.