URL
接口的password
属性为USVString
,其中包含在域名之前指定的密码。
如果在未设置username属性的情况下进行调用,默认失败。
Note: 此特性在 Web Worker 中可用。
语法
string = object.password; object.password = string;
值
A 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"
规范
Specification | Status | Comment |
---|---|---|
URL URL.password |
Living Standard | Initial definition. |
浏览器兼容
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
- The
URL
interface it belongs to.