body <- dashboardBody( useShinyjs(), # This will call message-handler.js tags$head(tags$script(src = "js/alert_message.js"), tags$link(rel = "stylesheet", type = "text/css", href = "css/tmod.css")), tags$script(HTML('$(document).ready(function() { $("header").find("nav").append(\'<span class="myClass"> Text Here </span>\'); }) ')), tabItems( tabItem(tabName = "file_preview",
Shiny.addCustomMessageHandler("header_message", function(headerMessage){ $("header").find("nav").append('<span class="myClass"> Text Here</span>', headerMessage) });
# in server.R, I try to call js function. But it does not show any thing.
observe({ input$run mess <- "I am worried about you" session$sendCustomMessage(type="header_message", mess) })