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