Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

r - Is it possible set params in a shiny app and send these to a function in JavaScript?

I wonder if it is possible to send a json file from shiny and call a function in javascript that uses this json file as a parameter.

This is my server

server <-  function(input, output, session){
  jsonstring <- read_json("Documents/HelloWorld.json")

  output$table2 <- renderTable({
    session$sendCustomMessage("OpenJSON", jsonstring)

And this is how I tried to pass my JSON file through the shiny app to javaScript

Shiny.addCustomMessageHandler("OpenJSON", download);

download() is my javascript function that I want to call in my shinyApp

But unfortunately, this did not work. How can I solve this?

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

547k answers


35.4k users