【问题标题】:What is the error in my shiny app that shows an iframe?我闪亮的应用程序中显示 iframe 的错误是什么?
【发布时间】:2018-09-16 21:48:05
【问题描述】:

我想在闪亮的应用程序中使用 iframe。我是 R 和闪亮的新手。这是我的代码:

library(shinyLP)
library(shiny)

ui <- fluidPage(
  fluidRow(
    htmlOutput("frame")    
  )
)

server <- function(input, output,session) {

    output$frame <- renderUI({
      link <- "http://www.ogame.de"
      Frame <- tags$iframe(width = "1042", height = "823", url_link = link)
      Frame
  })
}

shinyApp(ui, server)

如果我在框架中运行应用程序是“未找到”而不是谷歌。有什么问题?

【问题讨论】:

    标签: r iframe shiny


    【解决方案1】:

    你在找这个吗?

    library(shinyLP)
    library(shiny)
    
    ui <- fluidPage(
      fluidRow(
        htmlOutput("frame")    
      )
    )
    
    server <- function(input, output,session) {
    
      output$frame <- renderUI({
        link <- "http://www.ogame.de"
        Frame <- iframe(width = "1042", height = "823", url_link = link)
        Frame
      })
    }
    
    shinyApp(ui, server)
    

    (用浏览器打开)

    【讨论】:

      【解决方案2】:
      Put the link into the tags, like so:
      
          server <- function(input, output,session) {
      
            output$frame <- renderUI({
              Frame <- tags$iframe(src = "http://www.ogame.de",width = "1042", height = "823")
              Frame
            }) 
      }
      

      您不需要 shinyLPpackage 来显示 iFrame。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-19
        • 2016-12-31
        • 2016-01-06
        • 2017-03-24
        • 2018-05-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多