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/href/index.html | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 files/zh-cn/web/api/url/href/index.html (limited to 'files/zh-cn/web/api/url/href/index.html') diff --git a/files/zh-cn/web/api/url/href/index.html b/files/zh-cn/web/api/url/href/index.html new file mode 100644 index 0000000000..7bb80eb628 --- /dev/null +++ b/files/zh-cn/web/api/url/href/index.html @@ -0,0 +1,55 @@ +--- +title: URL.href +slug: Web/API/URL/href +translation_of: Web/API/URL/href +--- +
{{ApiRef("URL API")}}
+ +

{{domxref("URL")}} 接口的 href 属性是一个包含完整 URL 的 {{domxref("USVString")}} 值。

+ +

{{AvailableInWorkers}}

+ +

语法

+ +
string = object.href;
+object.href = string;
+
+ +

返回值

+ +

{{domxref("USVString")}}.

+ +

示例

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

规范

+ + + + + + + + + + + + + + +
规范状态意见
{{SpecName('URL', '#dom-url-href', 'URL.href')}}{{Spec2('URL')}}初始定义
+ +

浏览器兼容

+ + + +

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

+ +

参考

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