Firefox Tomorrow

web api event

Document: beforescriptexecute event

View on MDN ↗

The beforescriptexecute event fires when a static <script> is about to start executing. It does not fire if the element is added dynamically, such as with appendChild().

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("beforescriptexecute", (event) => { })

onbeforescriptexecute = (event) => { }

Event type

A generic Event.

Examples

function starting(e) {
  logMessage(`Starting script with ID: ${e.target.id}`);
}

document.addEventListener("beforescriptexecute", starting);
// or
document.onbeforescriptexecute = starting;

View Live Example

Specifications

Not part of any specification.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also