【问题标题】:passing selectInput to html tag将 selectInput 传递给 html 标签
【发布时间】:2017-12-11 16:12:37
【问题描述】:

我有一个 html 标签 tags$a(href='mailto:email@helloWorld.com?subject=myReport&body=practice level = input$pe', "Click here!"),我想在我的标签中传递 input$pe。但现在,我只得到原始文本。任何帮助将不胜感激。

【问题讨论】:

  • tags$a(href=paste0('"mailto:email@helloWorld.com?subject=myReport&body=practice level=",input$pe,"'"), "Click here!") 或类似的工作是否有效。可能需要稍作更改才能使引用的级别相互配合。

标签: javascript html r shiny


【解决方案1】:

你可以使用 paste0:

tags$a(paste0("href='mailto:email@helloWorld.com?subject=myReport&body=practice level = ", input$pe,"'"), "Click here!")

如果input$pe = abc:

<a>
  href='mailto:email@helloWorld.com?subject=myReport&amp;body=practice level = abc'
  Click here!
</a>

【讨论】:

  • 您好弗洛里安,感谢您的快速回复。但结果是纯文本,而不是呈现为 HTML。
  • 嗨 Akbar,也许看看 here。这能解决你的问题吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-03
  • 1970-01-01
  • 2022-07-27
  • 2016-04-11
  • 2015-05-12
  • 1970-01-01
相关资源
最近更新 更多