From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/xmldocument/async/index.html | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 files/zh-cn/web/api/xmldocument/async/index.html (limited to 'files/zh-cn/web/api/xmldocument/async') diff --git a/files/zh-cn/web/api/xmldocument/async/index.html b/files/zh-cn/web/api/xmldocument/async/index.html new file mode 100644 index 0000000000..f1e29dee9d --- /dev/null +++ b/files/zh-cn/web/api/xmldocument/async/index.html @@ -0,0 +1,30 @@ +--- +title: XMLDocument.async +slug: Web/API/XMLDocument/async +translation_of: Web/API/XMLDocument/async +--- +

{{APIRef("DOM")}}{{Non-standard_header}}{{Deprecated_header}}

+ +

document.async 可以被赋值,用来表明 document.load 被调用时,是使用异步模式还是同步模式进行请求. true 为默认值, 表明该文档应该被异步加载.

+ +

(从Gecko 1.4alpha 开始,文档请求可以以异步模式进行,在这之前,只有同步模式可用.)

+ +

代码示例

+ +
function loadXMLData(e)
+{
+alert(new XMLSerializer().serializeToString(e.target)); // 返回一个包含querydata.xml内容的字符串.
+}
+
+var xmlDoc = document.implementation.createDocument("", "test", null);
+xmlDoc.async = false;
+xmlDoc.onload = loadXMLData;
+xmlDoc.load('querydata.xml');
+
+ +

相关链接

+ + -- cgit v1.2.3-54-g00ecf