| on | R Documentation |
on() creates an event handler that can be passed to app() together
with the widgets. It is equivalent to calling app$on().
on(type, selector = NULL, handler)
type |
Event type such as |
selector |
Optional selector (e.g. |
handler |
|
The handler runs when an event of the given type reaches the app and, if a selector is given, the widget that sent the event matches it.
An object of class termr_handler.
on("button.pressed", "#hello", function(event, app) {
app$query_one("#output")$update("Hello!")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.