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 the translation of Event.returnValue #23465

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Changes from 2 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
24 changes: 13 additions & 11 deletions files/zh-cn/web/api/event/returnvalue/index.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
---
title: Event.returnValue
title: EventreturnValue 属性
slug: Web/API/Event/returnValue
l10n:
sourceCommit: d8f04d843dd81ab8cea1cfc0577ae3c5c9b77d5c
---

{{APIRef("DOM")}}{{Deprecated_Header}}
yin1999 marked this conversation as resolved.
Show resolved Hide resolved

**`Event.returnValue`** 属性表示该事件的默认操作是否已被阻止。默认情况下,它被设置为 `true`,即允许进行默认操作。将该属性设置为 `false` 即可阻止默认操作。
{{domxref("Event")}} 接口的 **`returnValue`** 属性表示该事件的默认操作是否已被阻止。

默认情况下,它被设置为 `true`,即允许进行默认操作。将该属性设置为 `false` 即可阻止默认操作。

> [!NOTE]
> While `returnValue` has been adopted into the DOM standard, it is present primarily to support existing code. You should use {{DOMxRef("Event.preventDefault", "preventDefault()")}}, and {{domxref("Event.defaultPrevented", "defaultPrevented")}} instead of this historical property.
> 虽然 `returnValue` 已被纳入 DOM 标准,但它主要是为了支持现有代码。你应该使用 {{DOMxRef("Event.preventDefault", "preventDefault()")}} {{domxref("Event.defaultPrevented", "defaultPrevented")}} 来代替这个历史遗留属性。

## 值

A {{domxref("Boolean")}} value which is `true` if the event has not been canceled; otherwise, if the event has been canceled or the default has been prevented, the value is `false`.

The value returned by `returnValue` is the opposite of the value returned by {{domxref("Event.defaultPrevented", "defaultPrevented")}}.

## 使用说明
布尔值,如果事件没有被取消,则为 `true`;否则,如果事件已被取消或默认操作已被阻止,则为 `false`。

`returnValue` was introduced into the DOM by Internet Explorer 6, and due to that browser's ubiquity became so commonly used that other browsers eventually implemented it as well. It has been adopted into the DOM specification, primarily to ensure that existing web content continues to function going forward.

New projects should generally avoid using `returnValue`, although they may if they choose to do so.
`returnValue` 的值与 {{domxref("Event.defaultPrevented", "defaultPrevented")}} 返回的值相反。

## 规范

Expand All @@ -29,3 +27,7 @@ New projects should generally avoid using `returnValue`, although they may if th
## 浏览器兼容性

{{Compat}}

## 参见

- {{domxref("HTMLDialogElement.returnValue")}}:{{HTMLElement("dialog")}} 的返回值。