From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/url/\345\257\206\347\240\201/index.html" | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 "files/zh-cn/web/api/url/\345\257\206\347\240\201/index.html" (limited to 'files/zh-cn/web/api/url/密码/index.html') diff --git "a/files/zh-cn/web/api/url/\345\257\206\347\240\201/index.html" "b/files/zh-cn/web/api/url/\345\257\206\347\240\201/index.html" new file mode 100644 index 0000000000..1592676a9d --- /dev/null +++ "b/files/zh-cn/web/api/url/\345\257\206\347\240\201/index.html" @@ -0,0 +1,57 @@ +--- +title: URL.密码 +slug: Web/API/URL/密码 +translation_of: Web/API/URL/password +--- +
{{ApiRef("URL API")}}
+ +

 {{domxref("URL")}}接口的password属性为{{domxref("USVString")}},其中包含在域名之前指定的密码。

+ +

如果在未设置username属性的情况下进行调用,默认失败。

+ +

{{AvailableInWorkers}}

+ +

语法

+ +
string = object.password;
+object.password = string;
+
+ +

+ +

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

+ +

Examples

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

规范

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

浏览器兼容

+ + + +

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

+ +

参见

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