MDN self-hosted library · e01.org

ErrorEvent: filename property

HTML DOM

Open notebook · 1 cells web-api-instance-property upstream source

HTML DOM

The filename read-only property of the ErrorEvent interface returns a string containing the name of the script file in which the error occurred.

Value

A string.

Examples

window.addEventListener("error", (ev) => {
  console.log(`The error occur in file: ${ev.filename}`);
});

Specifications

Browser compatibility