Skip to content

Commit

Permalink
[zh-cn]: update the translation of URL hostname property (#20669)
Browse files Browse the repository at this point in the history
  • Loading branch information
T34-active authored May 20, 2024
1 parent ad038fc commit 54aabab
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions files/zh-cn/web/api/url/hostname/index.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
---
title: URL.hostname
title: URLhostname 属性
slug: Web/API/URL/hostname
l10n:
sourceCommit: 4de6f76bbfd76229db78ffb7d52cf6b4cb9f31f8
---

{{ApiRef("URL API")}}
{{ApiRef("URL API")}} {{AvailableInWorkers}}

{{domxref("URL")}} 接口的 **`hostname`** 属性是一个 {{domxref("USVString")}} 值,包含有 URL 中的域名
{{domxref("URL")}} 接口的 **`hostname`** 属性是一个包含 URL 的{{glossary("domain name", "域名")}}的字符串

{{AvailableInWorkers}}
##

## 语法

```plain
string = object.hostname;
object.hostname = string;
```

### 返回值

{{domxref("USVString")}}.
字符串。

## 示例

```js
var url = new URL(
const url = new URL(
"https://developer.mozilla.org/zh-CN/docs/Web/API/URL/hostname",
);
var result = url.hostname; // Returns:'developer.mozilla.org'
console.log(url.hostname); // 输出:'developer.mozilla.org'
```

## 规范
Expand All @@ -37,6 +30,6 @@ var result = url.hostname; // Returns:'developer.mozilla.org'

{{Compat}}

## 参考
## 参见

- 属的 {{domxref("URL")}} 接口。
- 所属的 {{domxref("URL")}} 接口。

0 comments on commit 54aabab

Please sign in to comment.