From 9a110dee28ae2ef12ee014b98fda6bae6ee48edb Mon Sep 17 00:00:00 2001 From: YujiSoftware Date: Wed, 2 Mar 2022 20:22:51 +0900 Subject: Migrate to Compat macro (zh-cn) --- .../xmlhttprequest/getresponseheader/index.html | 61 +---------- .../html_in_xmlhttprequest/index.html | 51 +-------- files/zh-cn/web/api/xmlhttprequest/open/index.html | 53 +-------- .../readystatechange_event/index.html | 52 +-------- .../web/api/xmlhttprequest/responsetext/index.html | 52 +-------- .../web/api/xmlhttprequest/responseurl/index.html | 52 +-------- .../web/api/xmlhttprequest/responsexml/index.html | 54 +--------- files/zh-cn/web/api/xmlhttprequest/send/index.html | 119 +-------------------- .../api/xmlhttprequest/setrequestheader/index.html | 53 +-------- .../api/xmlhttprequest/timeout_event/index.html | 56 +--------- .../zh-cn/web/api/xmlhttprequest/upload/index.html | 50 +-------- .../api/xmlhttprequest/withcredentials/index.html | 54 +--------- 12 files changed, 12 insertions(+), 695 deletions(-) (limited to 'files/zh-cn/web/api/xmlhttprequest') diff --git a/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html b/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html index fe2e66b3c0..050e7809f3 100644 --- a/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/getresponseheader/index.html @@ -69,66 +69,7 @@ client.onreadystatechange = function() {//设定侦听器onreadystatechange。

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
浏览器ChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
基础支持{{CompatChrome(1)}}{{CompatVersionUnknown}}{{CompatUnknown}}[1]{{CompatIe('5')}}[2]
- {{CompatIe('7')}}
{{CompatVersionUnknown}}{{CompatSafari('1.2')}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
-

浏览器

-
AndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基础支持{{CompatUnknown}}1.0{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1]从Firefox 49开始,在首选项network.http.keep_empty_response_headers_as_empty_string设置为true的情况下,空响应头将作为空字符串返回,默认为false。 在Firefox 49之前,空响应头已被忽略。从Firefox 50开始,该项默认设置为true。

- -

[2]该功能最开始是通过ActiveXObject()实现的。 直到Internet Explorer 7,标准的XMLHttpRequest才出现。

+{{Compat("api.XMLHttpRequest.getResponseHeader")}}

也请看看:

diff --git a/files/zh-cn/web/api/xmlhttprequest/html_in_xmlhttprequest/index.html b/files/zh-cn/web/api/xmlhttprequest/html_in_xmlhttprequest/index.html index 74e8cac761..a2c18c0878 100644 --- a/files/zh-cn/web/api/xmlhttprequest/html_in_xmlhttprequest/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/html_in_xmlhttprequest/index.html @@ -142,53 +142,4 @@ oReq.send(null);

Browser compatibility

-

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Support18{{CompatGeckoDesktop("11.0")}}10{{CompatUnknown}}{{CompatNo}}
- {{CompatVersionUnknown}}[1]
-
- -
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Support{{CompatUnknown}}{{CompatGeckoMobile("11.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] This feature was implemented in {{WebKitBug("74626")}}.

+{{Compat("api.XMLHttpRequest")}} diff --git a/files/zh-cn/web/api/xmlhttprequest/open/index.html b/files/zh-cn/web/api/xmlhttprequest/open/index.html index 431c77fb89..9816c0c889 100644 --- a/files/zh-cn/web/api/xmlhttprequest/open/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/open/index.html @@ -56,58 +56,7 @@ xhrReq.open(method, url, async, user

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(1)}}{{ CompatVersionUnknown}}{{CompatIe('5')}}[1]
- {{CompatIe('7')}}
{{CompatVersionUnknown}}{{CompatSafari('1.2')}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown}}1.0{{CompatVersionUnknown}}{{ CompatVersionUnknown}}{{ CompatVersionUnknown}}{{ CompatVersionUnknown}}
-
- -

[1] 该特性通过ActiveXObject()实现。Internet Explorer从7开始实现了标准的XMLHttpRequest。

+{{Compat("api.XMLHttpRequest.open")}}

参见

diff --git a/files/zh-cn/web/api/xmlhttprequest/readystatechange_event/index.html b/files/zh-cn/web/api/xmlhttprequest/readystatechange_event/index.html index 63cdfe5bf8..5e32e1b9e4 100644 --- a/files/zh-cn/web/api/xmlhttprequest/readystatechange_event/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/readystatechange_event/index.html @@ -68,54 +68,4 @@ xhr.send();

浏览器兼容性

-

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatChrome(1)}}{{CompatGeckoDesktop(1.0)}}{{CompatIe(7)}}[1]{{CompatVersionUnknown}}{{CompatSafari(1.2)}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}1.0{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] IE 5 和 6可以通过使用 ActiveXObject() 支持ajax。

+{{Compat("api.XMLHttpRequest.readystatechange_event")}} diff --git a/files/zh-cn/web/api/xmlhttprequest/responsetext/index.html b/files/zh-cn/web/api/xmlhttprequest/responsetext/index.html index 5b6708acd4..5fc809707b 100644 --- a/files/zh-cn/web/api/xmlhttprequest/responsetext/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/responsetext/index.html @@ -61,54 +61,4 @@ xhr.send(null);

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}[1]{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] 在IE10前的版本请求完成时, XMLHttpRequest.responseText 的值为只读。

+{{Compat("api.XMLHttpRequest.responseText")}} diff --git a/files/zh-cn/web/api/xmlhttprequest/responseurl/index.html b/files/zh-cn/web/api/xmlhttprequest/responseurl/index.html index 4e70133f8b..289cb10feb 100644 --- a/files/zh-cn/web/api/xmlhttprequest/responseurl/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/responseurl/index.html @@ -37,54 +37,4 @@ xhr.send(null);

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(37.0)}}{{CompatGeckoDesktop("32.0")}}{{CompatNo}}{{CompatOpera("24")}}{{CompatSafari(8.0)}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

 

+{{Compat("api.XMLHttpRequest.responseURL")}} diff --git a/files/zh-cn/web/api/xmlhttprequest/responsexml/index.html b/files/zh-cn/web/api/xmlhttprequest/responsexml/index.html index ffd22d7896..8f0c8574e7 100644 --- a/files/zh-cn/web/api/xmlhttprequest/responsexml/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/responsexml/index.html @@ -72,59 +72,7 @@ xhr.send(null);

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)[1]Microsoft EdgeInternet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

[1] 在 Firefox 51 之前, 解析收到数据的错误会在 {{domxref("Document")}} 的顶部添加一个 <parsererror> 节点,并且在任何状态下返回 Document 。这是不符合规范的。从 Firefox 51开始,这种情况可以正确的返回 null。

+{{Compat("api.XMLHttpRequest.responseXML")}}

了解更多

diff --git a/files/zh-cn/web/api/xmlhttprequest/send/index.html b/files/zh-cn/web/api/xmlhttprequest/send/index.html index 820c7eb8b0..21f5c7fbe1 100644 --- a/files/zh-cn/web/api/xmlhttprequest/send/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/send/index.html @@ -132,124 +132,7 @@ xhr.send("foo=bar&lorem=ipsum");

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
特点ChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
基本支持{{CompatChrome(1)}}{{CompatGeckoDesktop("1.0")}}{{CompatIe('5')}}[2]
- {{CompatIe('7')}}
{{CompatVersionUnknown}}{{CompatSafari('1.2')}}
send(ArrayBuffer){{CompatChrome(9)}}{{CompatGeckoDesktop("9.0")}}[1]{{CompatIe('10')}}{{CompatOpera('11.60')}}{{compatUnknown}}
send(ArrayBufferView){{CompatChrome(22)}}{{CompatGeckoDesktop("20.0")}}{{compatUnknown}}{{compatUnknown}}{{compatUnknown}}
send(Blob){{CompatChrome(7)}}{{CompatGeckoDesktop("1.9.2")}}{{CompatIe('10')}}{{CompatOpera('12')}}{{compatUnknown}}
send(FormData){{CompatChrome(6)}}{{CompatGeckoDesktop("2.0")}}{{CompatIe('10')}}{{CompatOpera('12')}}{{compatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
特点AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支持{{CompatUnknown}}1.0{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
send(ArrayBuffer){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{compatUnknown}}
send(ArrayBufferView){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{compatUnknown}}
send(Blob){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{compatUnknown}}
send(FormData){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{compatUnknown}}
-
- -

[1] 发送一个简单的ArrayBuffer对象已不再是ajax规范一部分,也已经被弃用了。请使用 已被加入Gecko 20.0 {{geckoRelease("20.0")}}的ArrayBufferView

- -

[2] 由于 Internet Explorer 7实现了标准的XMLHttpRequest,此功能通过ActiveXObject()实现。

+{{Compat("api.XMLHttpRequest.send")}}

参见

diff --git a/files/zh-cn/web/api/xmlhttprequest/setrequestheader/index.html b/files/zh-cn/web/api/xmlhttprequest/setrequestheader/index.html index 2aaf964b5b..5a1c2988e6 100644 --- a/files/zh-cn/web/api/xmlhttprequest/setrequestheader/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/setrequestheader/index.html @@ -51,58 +51,7 @@ translation_of: Web/API/XMLHttpRequest/setRequestHeader

兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(1)}}{{CompatUnknown}}{{CompatIe('5')}}[1]
- {{CompatIe('7')}}
{{CompatVersionUnknown}}{{CompatSafari('1.2')}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}1.0{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] 使用ActiveXObject()实现的。Internet Explorer 7之后使用的是标准的XMLHttpRequest。

+{{Compat("api.XMLHttpRequest.setRequestHeader")}}

参考

diff --git a/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.html b/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.html index 00d587fced..86261f8dfd 100644 --- a/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/timeout_event/index.html @@ -65,61 +65,7 @@ translation_of: Web/API/XMLHttpRequest/timeout_event

浏览器兼容性

-

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support1.0{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9.1")}}10.0{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidAndroid WebviewEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9.1")}}10.0{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
+{{Compat("api.XMLHttpRequest.timeout_event")}}

相关链接

diff --git a/files/zh-cn/web/api/xmlhttprequest/upload/index.html b/files/zh-cn/web/api/xmlhttprequest/upload/index.html index eed9701557..df0e2a83b2 100644 --- a/files/zh-cn/web/api/xmlhttprequest/upload/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/upload/index.html @@ -65,52 +65,4 @@ translation_of: Web/API/XMLHttpRequest/upload

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
+{{Compat("api.XMLHttpRequest.upload")}} diff --git a/files/zh-cn/web/api/xmlhttprequest/withcredentials/index.html b/files/zh-cn/web/api/xmlhttprequest/withcredentials/index.html index d91fa7cc87..db46b8c6ed 100644 --- a/files/zh-cn/web/api/xmlhttprequest/withcredentials/index.html +++ b/files/zh-cn/web/api/xmlhttprequest/withcredentials/index.html @@ -48,56 +48,4 @@ xhr.send(null);

浏览器兼容性

-
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(3)}}{{CompatGeckoDesktop("1.9.1")}}[2]{{CompatIe(10)}}[1]{{CompatOpera(12)}}{{CompatSafari("4")}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}[2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1]IE8 和IE9通过使用  XDomainRequest 支持跨域请求

- -

[2] 从 Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8)开始, Gecko 不允许在同步请求下使用withCredentials 属性.尝试这么做将会导致浏览器抛出 NS_ERROR_DOM_INVALID_ACCESS_ERR exception的错误.

+{{Compat("api.XMLHttpRequest.withCredentials")}} -- cgit v1.2.3-54-g00ecf