jseval: Evaluate JS code

Description Usage Arguments Value Examples

View source: R/jseval_and_hooks.R

Description

Evaluate JavaScript code in the application.

Usage

1
jseval(code)

Arguments

code

JavaScript code given as a string

Value

A list containing the URL-encoded JavaScript code.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(shiny)
library(shinyChakraUI)

ui <- chakraPage(

  br(),

  chakraComponent(
    "mycomponent",

    Tag$Button(
      colorScheme = "pink",
      size = "lg",
      onClick = jseval('() => alert("Hello Chakra")'),
      "Trigger alert"
    )

  )

)

server <- function(input, output, session){}

if(interactive()){
  shinyApp(ui, server)
}

shinyChakraUI documentation built on Jan. 5, 2022, 5:08 p.m.