Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zh-cn] sync translated content #17052

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions files/zh-cn/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,7 @@
/zh-CN/docs/Web/API/HTMLTableElement.deleteTHead /zh-CN/docs/Web/API/HTMLTableElement/deleteTHead
/zh-CN/docs/Web/API/HTMLVideoElement/autoPictureInPicture /zh-CN/docs/Web/API/HTMLVideoElement
/zh-CN/docs/Web/API/Headers/getAll /zh-CN/docs/Web/API/Headers/get
/zh-CN/docs/Web/API/History_API/Example /zh-CN/docs/conflicting/Web/API/History_API/Working_with_the_History_API
/zh-CN/docs/Web/API/IDBCursor.direction /zh-CN/docs/Web/API/IDBCursor/direction
/zh-CN/docs/Web/API/IDBDatabase/onversionchange /zh-CN/docs/Web/API/IDBDatabase/versionchange_event
/zh-CN/docs/Web/API/IDBFactory.open /zh-CN/docs/Web/API/IDBFactory/open
Expand Down Expand Up @@ -2591,11 +2592,11 @@
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module /zh-CN/docs/WebAssembly/JavaScript_interface/Module
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError /zh-CN/docs/WebAssembly/JavaScript_interface/RuntimeError
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table /zh-CN/docs/WebAssembly/JavaScript_interface/Table
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile /zh-CN/docs/WebAssembly/JavaScript_interface/compile
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming /zh-CN/docs/WebAssembly/JavaScript_interface/compileStreaming
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate /zh-CN/docs/WebAssembly/JavaScript_interface/instantiate
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming /zh-CN/docs/WebAssembly/JavaScript_interface/instantiateStreaming
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate /zh-CN/docs/WebAssembly/JavaScript_interface/validate
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile /zh-CN/docs/WebAssembly/JavaScript_interface/compile_static
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming /zh-CN/docs/WebAssembly/JavaScript_interface/compileStreaming_static
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate /zh-CN/docs/WebAssembly/JavaScript_interface/instantiate_static
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming /zh-CN/docs/WebAssembly/JavaScript_interface/instantiateStreaming_static
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate /zh-CN/docs/WebAssembly/JavaScript_interface/validate_static
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/null /zh-CN/docs/Web/JavaScript/Reference/Operators/null
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/uneval /zh-CN/docs/Web/JavaScript/Reference/Global_Objects
/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/生成器函数 /zh-CN/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction
Expand Down Expand Up @@ -2693,6 +2694,11 @@
/zh-CN/docs/Web/性能 /zh-CN/docs/Web/Performance
/zh-CN/docs/Web/演示说明 /zh-CN/docs/Web/Demos
/zh-CN/docs/WebAPI/Using_geolocation /zh-CN/docs/Web/API/Geolocation_API
/zh-CN/docs/WebAssembly/JavaScript_interface/compile /zh-CN/docs/WebAssembly/JavaScript_interface/compile_static
/zh-CN/docs/WebAssembly/JavaScript_interface/compileStreaming /zh-CN/docs/WebAssembly/JavaScript_interface/compileStreaming_static
/zh-CN/docs/WebAssembly/JavaScript_interface/instantiate /zh-CN/docs/WebAssembly/JavaScript_interface/instantiate_static
/zh-CN/docs/WebAssembly/JavaScript_interface/instantiateStreaming /zh-CN/docs/WebAssembly/JavaScript_interface/instantiateStreaming_static
/zh-CN/docs/WebAssembly/JavaScript_interface/validate /zh-CN/docs/WebAssembly/JavaScript_interface/validate_static
/zh-CN/docs/WebAssembly/概念 /zh-CN/docs/WebAssembly/Concepts
/zh-CN/docs/WebGL /zh-CN/docs/Web/API/WebGL_API
/zh-CN/docs/WebGL/Getting_started_with_WebGL /zh-CN/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL
Expand Down
28 changes: 14 additions & 14 deletions files/zh-cn/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -10932,10 +10932,6 @@
"xgqfrms-GitHub"
]
},
"Web/API/History_API/Example": {
"modified": "2019-07-31T00:29:31.092Z",
"contributors": ["Shadowhiker", "xgqfrms"]
},
"Web/API/History_API/Working_with_the_History_API": {
"modified": "2020-09-07T23:10:09.451Z",
"contributors": ["Nothing_bin"]
Expand Down Expand Up @@ -32727,23 +32723,23 @@
"modified": "2020-11-04T03:44:08.051Z",
"contributors": ["moniang", "hurrytospring"]
},
"WebAssembly/JavaScript_interface/compile": {
"modified": "2020-10-15T21:58:44.128Z",
"contributors": ["kungfucode-rex"]
},
"WebAssembly/JavaScript_interface/compileStreaming": {
"WebAssembly/JavaScript_interface/compileStreaming_static": {
"modified": "2020-10-15T22:15:30.451Z",
"contributors": ["Cyandev"]
},
"WebAssembly/JavaScript_interface/instantiate": {
"modified": "2020-10-15T21:57:59.458Z",
"contributors": ["wallena3", "Hedgehog", "airt", "kungfucode-rex"]
"WebAssembly/JavaScript_interface/compile_static": {
"modified": "2020-10-15T21:58:44.128Z",
"contributors": ["kungfucode-rex"]
},
"WebAssembly/JavaScript_interface/instantiateStreaming": {
"WebAssembly/JavaScript_interface/instantiateStreaming_static": {
"modified": "2020-10-15T22:11:30.410Z",
"contributors": ["Xiaoming666"]
},
"WebAssembly/JavaScript_interface/validate": {
"WebAssembly/JavaScript_interface/instantiate_static": {
"modified": "2020-10-15T21:57:59.458Z",
"contributors": ["wallena3", "Hedgehog", "airt", "kungfucode-rex"]
},
"WebAssembly/JavaScript_interface/validate_static": {
"modified": "2020-10-15T22:15:29.365Z",
"contributors": ["Cyandev"]
},
Expand Down Expand Up @@ -32793,5 +32789,9 @@
"skyfore",
"xgqfrms-GitHub"
]
},
"conflicting/Web/API/History_API/Working_with_the_History_API": {
"modified": "2019-07-31T00:29:31.092Z",
"contributors": ["Shadowhiker", "xgqfrms"]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Ajax navigation example
slug: Web/API/History_API/Example
slug: conflicting/Web/API/History_API/Working_with_the_History_API
original_slug: Web/API/History_API/Example
---

这是一个仅由三个页面组成的 AJAX 网站示例 (_first_page.php_, _second_page.php_ and _third_page.php_). 要查看其如何工作的,请创建以下文件 (或 git clone [https://github.com/giabao/mdn-ajax-nav-example.git](https://github.com/giabao/mdn-ajax-nav-example) ):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,4 @@ const currentState = history.state;
## 参见

- [历史记录 API](/zh-CN/docs/Web/API/History_API)
- [历史导航示例](/zh-CN/docs/Web/API/History_API/Example)
- {{domxref("window.history", "history")}} 全局对象
1 change: 0 additions & 1 deletion files/zh-cn/web/api/window/popstate_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ history.go(2); // 弹出 "location: http://example.com/example.html?page=3, stat

- {{domxref("window.history")}}
- [Manipulating the browser history](/zh-CN/docs/Web/API/History_API)
- [Ajax 导航示例](/zh-CN/docs/Web/API/History_API/Example)
2 changes: 0 additions & 2 deletions files/zh-cn/web/guide/ajax/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,6 @@ TIME: 312.15
- [监控请求过程](/zh-CN/docs/Web/API/XMLHttpRequest_API/Using_XMLHttpRequest#监控请求过程)
- [提交表单或者上传二进制文件](/zh-CN/docs/Web/API/XMLHttpRequest_API/Using_XMLHttpRequest#提交表单和上传文件),使用*纯* Ajax 或者 {{domxref("FormData")}} 对象
- 在 [Web worker](/zh-CN/docs/Web/API/Worker) 中使用 Ajax
- [_纯 Ajax_ 导航示例](/zh-CN/docs/Web/API/History_API/Example)
- : 本文提供了一个仅由三个页面组成的*纯 Ajax* 网站的(最小)工作示例。
- [发送和接收二进制数据](/zh-CN/docs/Web/API/XMLHttpRequest_API/Sending_and_Receiving_Binary_Data)
- : `XMLHttpRequest` 对象的 `responseType` 属性可以被设置来改变服务器的预期响应类型。可能的值是空字符串(默认)、`arraybuffer`、`blob`、`document`、`json` 和 `text`。`response` 属性将根据 `responseType` 包含,作为一个 `ArrayBuffer`、`Blob`、`Document`、`JSON` 或字符串的实体主体。这篇文章将展示一些 Ajax I/O 技术。
- [XML](/zh-CN/docs/Glossary/XML)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: WebAssembly.compile()
slug: WebAssembly/JavaScript_interface/compile
slug: WebAssembly/JavaScript_interface/compile_static
---

{{WebAssemblySidebar}} {{SeeCompatTable}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: WebAssembly.compileStreaming()
slug: WebAssembly/JavaScript_interface/compileStreaming
slug: WebAssembly/JavaScript_interface/compileStreaming_static
---

{{WebAssemblySidebar}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: WebAssembly.instantiate()
slug: WebAssembly/JavaScript_interface/instantiate
slug: WebAssembly/JavaScript_interface/instantiate_static
---

{{WebAssemblySidebar}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: WebAssembly.instantiateStreaming()
slug: WebAssembly/JavaScript_interface/instantiateStreaming
slug: WebAssembly/JavaScript_interface/instantiateStreaming_static
---

{{WebAssemblySidebar}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ slug: WebAssembly/JavaScript_interface/Module

### 将编译后的模块发送到 worker

以下示例将使用 [`WebAssembly.compileStreaming()`](/zh-CN/docs/WebAssembly/JavaScript_interface/compileStreaming) 方法编译 `simple.wasm` 加载后的字节码,并将返回的 `Module` 实例通过 {{domxref("Worker/postMessage", "postMessage()")}} 发送到一个 [worker](/zh-CN/docs/Web/API/Web_Workers_API)。
以下示例将使用 [`WebAssembly.compileStreaming()`](/zh-CN/docs/WebAssembly/JavaScript_interface/compileStreaming_static) 方法编译 `simple.wasm` 加载后的字节码,并将返回的 `Module` 实例通过 {{domxref("Worker/postMessage", "postMessage()")}} 发送到一个 [worker](/zh-CN/docs/Web/API/Web_Workers_API)。

参见 `index-compile.html` 的[源代码](https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/index-compile.html),或[查看在线演示](https://mdn.github.io/webassembly-examples/js-api-examples/index-compile.html)。

Expand All @@ -37,7 +37,7 @@ WebAssembly.compileStreaming(fetch("simple.wasm")).then((mod) =>
);
```

Worker 函数 [`wasm_worker.js`](https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/wasm_worker.js) 定义了模块需要使用的导入对象。然后,该函数会创建一个事件处理器,以接受主线程发送的模块。在接收到模块后,我们使用 [`WebAssembly.instantiate()`](/zh-CN/docs/WebAssembly/JavaScript_interface/instantiate) 方法创建一个它的实例,然后调用其导出的函数。
Worker 函数 [`wasm_worker.js`](https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/wasm_worker.js) 定义了模块需要使用的导入对象。然后,该函数会创建一个事件处理器,以接受主线程发送的模块。在接收到模块后,我们使用 [`WebAssembly.instantiate()`](/zh-CN/docs/WebAssembly/JavaScript_interface/instantiate_static) 方法创建一个它的实例,然后调用其导出的函数。

```js
const importObject = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const importObj = {
};
```

最后,我们使用 [`WebAssembly.instantiateStreaming()`](/zh-CN/docs/WebAssembly/JavaScript_interface/instantiateStreaming) 方法加载并实例化一个 Wasm 模块(table2.wasm)。table2.wasm 模块包含两个函数(一个返回 42,另一个返回 83),并将这两个函数分别存储到导入 Table 的 0 号和 1 号元素中(参见[文本表示](https://github.com/mdn/webassembly-examples/blob/main/js-api-examples/table2.wat))。因此,在实例化之后,表的长度仍然是 2,但元素中现在包含了可调用的 [WebAssembly 导出函数](/zh-CN/docs/WebAssembly/Exported_functions),可以通过 JS 调用这些函数。
最后,我们使用 [`WebAssembly.instantiateStreaming()`](/zh-CN/docs/WebAssembly/JavaScript_interface/instantiateStreaming_static) 方法加载并实例化一个 Wasm 模块(table2.wasm)。table2.wasm 模块包含两个函数(一个返回 42,另一个返回 83),并将这两个函数分别存储到导入 Table 的 0 号和 1 号元素中(参见[文本表示](https://github.com/mdn/webassembly-examples/blob/main/js-api-examples/table2.wat))。因此,在实例化之后,表的长度仍然是 2,但元素中现在包含了可调用的 [WebAssembly 导出函数](/zh-CN/docs/WebAssembly/Exported_functions),可以通过 JS 调用这些函数。

```js
WebAssembly.instantiateStreaming(fetch("table2.wasm"), importObject).then(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: WebAssembly.validate()
slug: WebAssembly/JavaScript_interface/validate
slug: WebAssembly/JavaScript_interface/validate_static
---

{{WebAssemblySidebar}}
Expand Down Expand Up @@ -41,15 +41,15 @@ fetch("simple.wasm")
});
```

## Specifications
## 规范

{{Specifications}}

## Browser compatibility
## 浏览器兼容性

{{Compat}}

## See also
## 参见

- [WebAssembly](/zh-CN/docs/WebAssembly) overview page
- [WebAssembly concepts](/zh-CN/docs/WebAssembly/Concepts)
Expand Down