Skip to content

Commit

Permalink
add docs for ErrorEvent.lineno
Browse files Browse the repository at this point in the history
  • Loading branch information
skyclouds2001 authored Oct 12, 2024
1 parent 8bbefa7 commit 91459d0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
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 @@ -25,7 +25,7 @@ _Also inherits properties from its parent {{domxref("Event")}}_.
- {{domxref("ErrorEvent.filename")}} {{ReadOnlyInline}}
- : A string containing the name of the script file in which the error occurred.
- {{domxref("ErrorEvent.lineno")}} {{ReadOnlyInline}}
- : An `integer` containing the line number of the script file on which the error occurred.
- : An integer containing the line number of the script file on which the error occurred.
- {{domxref("ErrorEvent.colno")}} {{ReadOnlyInline}}
- : An `integer` containing the column number of the script file on which the error occurred.
- {{domxref("ErrorEvent.error")}} {{ReadOnlyInline}}
Expand Down
31 changes: 31 additions & 0 deletions files/en-us/web/api/errorevent/lineno/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "ErrorEvent: lineno property"
short-title: lineno
slug: Web/API/ErrorEvent/lineno
page-type: web-api-instance-property
browser-compat: api.ErrorEvent.lineno
---

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

The **`lineno`** read-only property of the {{domxref("ErrorEvent")}} interface returns an integer containing the line number of the script file on which the error occurred.

## Value

An integer.

## Examples

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

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

0 comments on commit 91459d0

Please sign in to comment.