-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docs for
ErrorEvent()
constructor
- Loading branch information
1 parent
3d2cd62
commit 14c0a25
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: "ErrorEvent: ErrorEvent() constructor" | ||
short-title: ErrorEvent() | ||
slug: Web/API/ErrorEvent/ErrorEvent | ||
page-type: web-api-constructor | ||
browser-compat: api.ErrorEvent.ErrorEvent | ||
--- | ||
|
||
{{APIRef("HTML DOM")}}{{AvailableInWorkers}} | ||
|
||
The **`ErrorEvent()`** constructor creates a new {{domxref("ErrorEvent")}} object. | ||
|
||
## Syntax | ||
|
||
```js-nolint | ||
new ErrorEvent(type) | ||
new ErrorEvent(type, options) | ||
``` | ||
|
||
### Parameters | ||
|
||
- `type` | ||
- : A string with the name of the event. It is case-sensitive. | ||
- `options` {{optional_inline}} | ||
- : An object that, _in addition of the properties defined in {{domxref("Event/Event", "Event()")}}_, can have the following properties: | ||
- `message` {{optional_inline}} | ||
- : 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. | ||
- `filename` {{optional_inline}} | ||
- : A string containing the name of the script file in which the error occurred. | ||
- `lineno` {{optional_inline}} | ||
- : An `integer` containing the line number of the script file on which the error occurred. | ||
- `colno` {{optional_inline}} | ||
- : An `integer` containing the column number of the script file on which the error occurred. | ||
- `error` {{optional_inline}} | ||
- : A JavaScript `Object` that is concerned by the event. | ||
|
||
### Return value | ||
|
||
A new {{domxref("ErrorEvent")}} object. | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters