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/url/protocol/index.html | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 files/zh-cn/web/api/url/protocol/index.html (limited to 'files/zh-cn/web/api/url/protocol') diff --git a/files/zh-cn/web/api/url/protocol/index.html b/files/zh-cn/web/api/url/protocol/index.html new file mode 100644 index 0000000000..2774282d7e --- /dev/null +++ b/files/zh-cn/web/api/url/protocol/index.html @@ -0,0 +1,55 @@ +--- +title: URL.protocol +slug: Web/API/URL/protocol +translation_of: Web/API/URL/protocol +--- +
{{ApiRef("URL API")}}
+ +
{{domxref("URL")}}接口的protocol是一个包含URL协议的{{domxref("USVString")}}值,此值包含协议后的':'.
+ +

{{AvailableInWorkers}}

+ +

语法

+ +
string = object.protocol;
+object.protocol = string;
+
+ +

参数

+ +

A {{domxref("USVString")}}.

+ +

示例

+ +
var url = new URL('https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol');
+var result = url.protocol; // Returns:"https:"
+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('URL', '#dom-url-protocol', 'protocol')}}{{Spec2('URL')}}Initial definition.
+ +

浏览器兼容性

+ + + +

{{Compat("api.URL.protocol")}}

+ +

其他链接

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