function starting(e) {
logMessage(`Starting script with ID: ${e.target.id}`);
}
document.addEventListener("beforescriptexecute", starting);
// Or (but note that this replaces other event listeners
// added using onbeforescriptexecute, if any)
document.onbeforescriptexecute = starting;Document: beforescriptexecute event / notebook
Document: beforescriptexecute event
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.