Learn R Programming

shinyjs (version 0.0.7.0)

messageFuncs: Show a message

Description

info shows a message to the user as a simple popup. logjs writes a message to the JavaScript console. logjs is mainly used for debugging purposes as a way to non-intrusively print messages, but it is also visible to the user if they choose to inspect the console.

Usage

info(...)

logjs(...)

Arguments

...
The following parameters are available: ll{ text The message to show. Can be either simple quoted text or an R variable or expression. }

See Also

useShinyjs, runExample

Examples

Run this code
if (interactive()) {
  shiny::shinyApp(
    ui = shiny::fluidPage(
      useShinyjs(),  # Set up shinyjs
      shiny::actionButton("btn", "Click me")
    ),
    server = function(input, output, session) {
      shiny::observeEvent(input$btn, {
        # Change the following line for more examples
        info(paste0("The date is ", date()))
      })
    }
  )
}
# The shinyjs function call in the above app can be replaced by
  # any of the following examples to produce similar Shiny apps
  info("Hello!")
  info(text = R.Version())
  logjs(R.Version())

Run the code above in your browser using DataLab