I need to embed a webpage reached through a url inputted by the user. I found this script but I can't make the iframe depend on a textInput() containing a url.
Thank you
I need to embed a webpage reached through a url inputted by the user. I found this script but I can't make the iframe depend on a textInput() containing a url.
Thank you
You can do like this:
library(shiny)
ui <- fluidPage(titlePanel("Getting Iframe"),
sidebarLayout(
sidebarPanel(
textInput("url", label = "Enter url"),
actionButton("go", "Go")
),
mainPanel(
htmlOutput("frame")
)
))
server <- function(input, output) {
output$frame <- renderUI({
validate(need(input$go, message=FALSE))
tags$iframe(src=isolate(input$url), height=600, width=535)
})
}
shinyApp(ui, server)