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/port/index.html | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 files/zh-cn/web/api/url/port/index.html (limited to 'files/zh-cn/web/api/url/port') diff --git a/files/zh-cn/web/api/url/port/index.html b/files/zh-cn/web/api/url/port/index.html new file mode 100644 index 0000000000..5a50e2daf1 --- /dev/null +++ b/files/zh-cn/web/api/url/port/index.html @@ -0,0 +1,57 @@ +--- +title: URL.port +slug: Web/API/URL/port +translation_of: Web/API/URL/port +--- +
{{ApiRef("URL API")}}
+ +
{{domxref("URL")}} 接口的端口属性是包含了URL的端口号信息的{{domxref("USVString")}}值,如果URL中不包含明确的端口号,这个属性将为''.
+ +
+ +

{{AvailableInWorkers}}

+ +

语法

+ +
string = object.port;
+object.port = string;
+
+ +

参数

+ +

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

+ +

示例

+ +
var url = new URL('https://mydomain.com:80/svn/Repos/');
+var result = url.port; // Returns:'80'
+
+ +

规范

+ + + + + + + + + + + + + + +
规范状态备注
{{SpecName('URL', '#dom-url-port', 'URL.port')}}{{Spec2('URL')}}Initial definition.
+ +

浏览器兼容性

+ + + +

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

+ +

相关链接

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