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

Add docs for ErrorEvent.message #36280

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion files/en-us/web/api/errorevent/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The **`ErrorEvent`** interface represents events providing information related t
_Also inherits properties from its parent {{domxref("Event")}}_.

- {{domxref("ErrorEvent.message")}} {{ReadOnlyInline}}
- : A string containing a human-readable error message describing the problem. Lacking a [`crossorigin`](/en-US/docs/Web/HTML/Attributes/crossorigin) setting reduces error logging.
- : A string containing a human-readable error message describing the problem.
- {{domxref("ErrorEvent.filename")}} {{ReadOnlyInline}}
- : A string containing the name of the script file in which the error occurred.
- {{domxref("ErrorEvent.lineno")}} {{ReadOnlyInline}}
Expand Down
31 changes: 31 additions & 0 deletions files/en-us/web/api/errorevent/message/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "ErrorEvent: message property"
short-title: message
slug: Web/API/ErrorEvent/message
page-type: web-api-instance-property
browser-compat: api.ErrorEvent.message
---

{{APIRef("HTML DOM")}}{{AvailableInWorkers}}

The **`message`** read-only property of the {{domxref("ErrorEvent")}} interface returns a string containing a human-readable error message describing the problem.

## Value

A string.

## Examples

```js
window.addEventListener("error", (ev) => {
console.log("The error message: " + ev.message);
});
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}