R闪亮会话$ sendCustomMessage消息中的换行符

时间:2016-10-31 10:22:04

标签: json shiny

通过sendCustomMessage在邮件发送的js字符串中插入换行符的方法是什么?

rm(list = ls())
library(shiny)



ui =fluidPage(
  tags$head(tags$script(HTML('Shiny.addCustomMessageHandler("jsCode",function(message) {eval(message.value);});'))),
  actionButton("click","click to send message")
)

server = function(input, output, session) {

 observe({
    if(!is.null(input$click)){
       string_to_break <-"alert(\"Line1. Line2.\");"
       session$sendCustomMessage(type='jsCode', list(value = string_to_break ))
  }
 })


 }
runApp(list(ui = ui, server = server))

由于

0 个答案:

没有答案