I want to know if it is possible to use variables created in runjs()
in my R code.
For example will I be able to access the variable today_var
outside the runjs()
function for further analysis.
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
useShinyjs(),
actionButton("btn", "Click me")
),
server = function(input, output) {
observeEvent(input$btn, {
runjs("var today_var = new Date(); alert(today);")
#print(today_var)
})
}
)
}
Thanks in advance