aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/url/密码/index.html
blob: 1592676a9d75a3ace6f67fad80691d99d15ccdf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: URL.密码
slug: Web/API/URL/密码
translation_of: Web/API/URL/password
---
<div>{{ApiRef("URL API")}}</div>

<p> {{domxref("URL")}}<span class="tlid-translation translation" lang="zh-CN"><span title="">接口的<strong><code>password</code></strong>属性为</span></span>{{domxref("USVString")}}<span class="tlid-translation translation" lang="zh-CN"><span title="">,其中包含在域名之前指定的密码。</span></span></p>

<p><span class="tlid-translation translation" lang="zh-CN"><span title="">如果在未设置</span></span><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/API/URL/username">username</a><span class="tlid-translation translation" lang="zh-CN"><span title="">属性的情况下进行调用,默认失败。</span></span></p>

<p>{{AvailableInWorkers}}</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox"><em>string</em> = <em>object</em>.password;
<em>object</em>.password = <em>string</em>;
</pre>

<h3 id="值"></h3>

<p>A {{domxref("USVString")}}.</p>

<h2 id="Examples">Examples</h2>

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

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('URL', '#dom-url-password', 'URL.password')}}</td>
   <td>{{Spec2('URL')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容">浏览器兼容</h2>



<p>{{Compat("api.URL.password")}}</p>

<h2 id="参见">参见</h2>

<ul>
 <li>The {{domxref("URL")}} interface it belongs to.</li>
</ul>