ExecuteScript

data class ExecuteScript(val script: Script, val autoRemove: Boolean = true, val attributes: List<Pair<String, String>> = emptyList(), val id: SseEventId? = null) : DatastarEvent

The datastar-execute-script event is used to execute JavaScript in the browser. The autoRemove line determines whether to remove the script after execution. Each attributes line adds an attribute (in the format name value) to the script element. Each script line contains JavaScript to be executed by the browser.

Constructors

Link copied to clipboard
constructor(script: Script, autoRemove: Boolean = true, attributes: List<Pair<String, String>> = emptyList(), id: SseEventId? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val autoRemove: Boolean = true
Link copied to clipboard
Link copied to clipboard
open override val id: SseEventId? = null
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard