Reading javascript variable into shiny/R on app load

前端 未结 2 1126
刺人心
刺人心 2020-12-09 23:53

What I want to do is get the user ID from a wordpress logged-in user when I load a shiny app in an iframe. This variable could then be used to save and modify user-specific

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 00:21

    If you want to call onInputChange as soon as the Shiny app starts then you need to use the following JavaScript code instead of listening for click events.

    $(function() {
      setTimeout(function() {
        Shiny.onInputChange("mydata", userID);
      }, 10)
    });
    

提交回复
热议问题