【问题标题】:how to open the url as a pop in shiny如何在闪亮中打开网址作为弹出窗口
【发布时间】: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


【解决方案1】:

试试

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-28
    • 2014-11-06
    • 2017-02-27
    • 1970-01-01
    • 1970-01-01
    • 2017-01-10
    • 2023-02-26
    • 1970-01-01
    相关资源
    最近更新 更多