Search code examples
javascriptrshinyrshiny

how to open the url as a pop in shiny


With this code i can open the link as a new tab but dont know how to open this as a pop or adjustable window

> library(shiny)
    u_id<-123
    inv_id <-111
    url <- paste0("https://www.google.com/","?id=",u_id, "&inv_id=", inv_id)
    ui <- fluidPage(shiny::fluidRow(shiny::actionButton(inputId='ab1', 
       label="click here", value = "Open popup",
       onclick = sprintf("window.open('%s')",url,'resizable,height=260,width=370')))) # Combine text with url variable
    server <- function(input, output) {}
    shinyApp(ui, server)

Solution

  • Try

    sprintf("window.open('%s','win','resizable,height=260,width=370')",url)