【发布时间】:2021-10-18 07:17:55
【问题描述】:
使用此代码,我可以将链接作为新标签打开,但不知道如何将其作为弹出窗口或可调整窗口打开
> 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)
【问题讨论】:
-
你缺少一个窗口名称输出应该是
window.open('someurl','windowname','resizable,height=260,width=370') -
我是 R 新手,请您编辑我的代码@mplungjan
标签: javascript r shiny rshiny