簡體   English   中英

在 Shiny 中寫入不帶標簽的閃亮$HTML(...)$head(...)

[英]Write shiny$HTML(...) without tags$head(...) in Shiny

我怎樣才能在下面只使用shiny$HTML而不是tags$head(shiny$HTML(...)來寫這個?

前任:

tags$head(
HTML("<title> Hell Tattoo Dashboard</title>
<link rel='shortcut icon' href='www/hell.png'></link>
<link rel='stylesheet' href='www/shiny.css'></link>
     <script src='www/shiny.js'></script>"
     )
)

作品。

我插入沒有tags$head<head>標簽:

HTML("<head>
<title> Hell Tattoo Dashboard</title>
<link rel='shortcut icon' href='www/hell.png'></link>
<link rel='stylesheet' href='www/shiny.css'></link>
     <script src='www/shiny.js'></script>
</head>"
     )

不起作用。

我想使用shiny$HTML標簽,只是純粹的,沒有tags$head 這是可能的?

簡單的閃亮應用:

library(shiny)
library(shinydashboard)

h <- dashboardHeader(title = "a")

s <- dashboardSidebar()

b <- dashboardBody()

ui <- dashboardPage(h, s, b, skin = "blue")

server <- function(input, output) {

}

shinyApp(ui, server)

這工作正常:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    HTML("<head>
            <title>Hell Tattoo Dashboard</title>
          </head>"
    )
  )
)

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

shinyApp(ui, server)

結果

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM