79291483

Date: 2024-12-18 14:46:11
Score: 3
Natty:
Report link

Thanks for the answer. However, I tried below that I thought a simple approach and it is working

WHat you say ?

library(shiny)
runApp(
  list(ui = fluidPage(

        tags$p(id = 'g', class =  'newClass',  'This is a paragraph'),tags$p(id = "demo"),
        tags$script('Shiny.addCustomMessageHandler("testmessage",
        function(message)
        {
        var tit = document.getElementById("g")
        tit.onclick = function (){document.getElementById("demo").innerHTML  = message}
        }
);')
        )
  , server = function(input, output, session){
    asd <- Sys.Date()
    observe({session$sendCustomMessage(type = 'testmessage',message = asd)})
  })
)
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Vinay Kumar