I want to send data from javascript to R using shiny js function, but is not working. What I have done is a simple example, in which setinputValue send "noone" to "too" input$too
Here is the code:
library(shiny)
ui <- fluidPage(
HTML("<script>
$( document ).ready(function() {
Shiny.setInputValue('too', 'noone');
});</script>"),
textOutput("table")
)
server <- function(input, output) {
output$table <- renderPrint(input$too)
}
shinyApp(ui,server)
The js error I get is: Shiny.setInputValue is not a function