Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zh-cn]: Update translation of String.blink() #15303

Merged
merged 3 commits into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,28 @@ slug: Web/JavaScript/Reference/Global_Objects/String/blink

{{JSRef}} {{deprecated_header}}

**`blink()`** 方法创建一个字符串,其在 `<blink>str</blink>` 中嵌入字符串,这使得字符串在旧版浏览器中闪烁。
{{jsxref("String")}} 值的 **`blink()`** 方法创建一个字符串,其在 `<blink>str</blink>` 中嵌入字符串,这使得字符串在旧版浏览器中闪烁。

> **警告:** 闪烁文本被多种普及标准否决。`<blink>` 元素自身是非标准的,并且已废弃!
> **备注:** 所有 [HTML 包装方法](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String#html_包装器方法)都已被弃用,并且仅为了兼容性而标准化。对于 `blink()` 方法,`<blink>` 元素本身已在现代浏览器中移除,并且闪烁文本违反了多个无障碍标准。请避免以任何方式使用该元素。

## 语法

```plain
str.blink()
```js-nolint
blink()
```

### 返回值

包含 `<blink>` HTML 元素的字符串。

## 描述

`blink()`方法将字符串嵌入 `<blink>` 标签中:`"<blink>str</blink>"`。
一个以 `<blink>` 开始标签开头的字符串,接着是文本 `str`,然后是 `</blink>` 结束标签。

## 示例

### 使用 `blink()` 函数
### 使用 blink()

下面的示例使用了字符串方法来修改字符串格式
以下示例使用已弃用的字符串方法来更改字符串的格式

```js
var worldString = "Hello, world";
const worldString = "Hello, world";

console.log(worldString.blink()); // <blink>Hello, world</blink>
console.log(worldString.bold()); // <b>Hello, world</b>
Expand All @@ -48,6 +44,7 @@ console.log(worldString.strike()); // <strike>Hello, world</strike>

## 参见

- [`core-js` 中 `String.prototype.blink` 的 polyfill](https://github.com/zloirock/core-js#ecmascript-string-and-regexp)
- {{jsxref("String.prototype.bold()")}}
- {{jsxref("String.prototype.italics()")}}
- {{jsxref("String.prototype.strike()")}}