Inline JavaScript not working within dashboardBody()
chuansunaacg opened this issue · comments
Hi all,
I used the example to create a redirect page for my Shiny app. The code works under fluidpage(), but doesn't work for our app under dashboardBody(). I'm familiar with R but not Javascript, so couldn;t really figure out why.
Below is a minimal reproducible example (of Javascript not working within dashboardBody()): (test2.html can be any html, I just use some text)
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
tags$script("
$('.container-fluid').load('./test.html');
}) });
"),
actionButton("disconnect", "Disconnect the app")
)
)
server <- function(input, output, session) {
observeEvent(input$disconnect, {
session$close()
})
}
shinyApp(ui, server)