Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
返回R中renderUi的完整HTML内容_Html_R_Shiny - Fatal编程技术网

返回R中renderUi的完整HTML内容

返回R中renderUi的完整HTML内容,html,r,shiny,Html,R,Shiny,是否可以获取页面的完整HTML文本,该文本在shiny中作为renderUi对象生成?我需要使用ajax生成屏幕截图的内容 示例1按预期工作:页面直接在ui中显示。生成的ui对象包含完整的HTML文本。它可以另存为.html文件,并在浏览器中打开以显示页面 ui <- fluidPage( div(numericInput("invalue", label = "Input", 10)), h4(div("Output")), textOutput("outvalue") )

是否可以获取页面的完整HTML文本,该文本在shiny中作为renderUi对象生成?我需要使用ajax生成屏幕截图的内容

示例1按预期工作:页面直接在ui中显示。生成的ui对象包含完整的HTML文本。它可以另存为.html文件,并在浏览器中打开以显示页面

ui <- fluidPage(
  div(numericInput("invalue", label = "Input", 10)),
  h4(div("Output")),
  textOutput("outvalue")
)

server <- function(input, output, session) {
output$outvalue <- renderText(input$invalue * 10)
}

shinyApp(ui, server)
ui
<div class="container-fluid">
  <div>
    <div class="form-group shiny-input-container">
      <label for="invalue">Input</label>
      <input id="invalue" type="number" class="form-control" value="10"/>
    </div>
  </div>
  <h4>
    <div>Output</div>
  </h4>
  <div id="outvalue" class="shiny-text-output"></div>
</div>
ui <- uiOutput("page")

server <- function(input, output, session) {
  output$outvalue <- renderText(input$invalue * 10)
  output$page <- renderUI({
    fluidPage(
      div(numericInput("invalue", label = "Input", 10)),
      h4(div("Output")),
      textOutput("outvalue")
    )
  })
}

shinyApp(ui, server)
<div id="page" class="shiny-html-output"></div>