internet explorer/IE11不处理shinyjs/jquery是否存在已知问题?
我有一个闪亮的应用程序托管在闪亮服务器和nginx上。我使用动作按钮和shinyjs根据ID切换元素。我的应用程序在所有其他主流浏览器上都能正常工作:Chrome、Firefox、Edge、Safari(我还没有测试Opera)。它还可以在多种操作系统上运行:Win7、Win10、Android、iPhone、Ubuntu 18.04。然而,InternetExplorer是一个破产。我只试过IE11,但我怀疑另一个版本是否有效。网站的负载很好,但按钮不是被动的 我不知道该怎么做来测试这个。我使用了IE的元素检查器,它将按钮识别为事件处理程序,并引用了Shiny自动生成的jquery文件。这就是我的问题所在:这是Internet Explorer和Shiny的特定兼容性问题,还是我的shinyjs代码有问题internet explorer/IE11不处理shinyjs/jquery是否存在已知问题?,jquery,r,internet-explorer,shiny,shinyjs,Jquery,R,Internet Explorer,Shiny,Shinyjs,我有一个闪亮的应用程序托管在闪亮服务器和nginx上。我使用动作按钮和shinyjs根据ID切换元素。我的应用程序在所有其他主流浏览器上都能正常工作:Chrome、Firefox、Edge、Safari(我还没有测试Opera)。它还可以在多种操作系统上运行:Win7、Win10、Android、iPhone、Ubuntu 18.04。然而,InternetExplorer是一个破产。我只试过IE11,但我怀疑另一个版本是否有效。网站的负载很好,但按钮不是被动的 我不知道该怎么做来测试这个。我使
library(shiny)
library(shinydashboard)
library("shinyjs")
library("tidyr")
library("dplyr")
ui <- fluidPage(
# welcome row ----
fluidRow(id = "welcome",
column(12,
h2(class = "display-4",
"Super Survey"),
p("Thank you for participating in this survey!"
),
hr(class = "my-4"),
p("Click 'Next' to get started"),
p(class = "lead",
actionButton(class = "btn btn-primary btn-lg",
"welcomenext",
"Next")
)
)),
useShinyjs(),
# questions row ----
fluidRow(id = "questions",
column(class = "card bg-light mb-3 px-0",
8,
div(id = "location",
div(class = "card-header text-white bg-dark",
h2(class="text-center",
"Where you're located")
),
div(class = "card-body",
p(class="card-text",
"Tell us where you are!."
),
# Input: Your Location ----
radioButtons(
inputId = "locationSelect",
"Select your location",
c("Location A", "Location B", "Location C"),
selected = character(0)
),
actionButton(class = "btn btn-primary btn-lg", "locationnext", "Next")
)
), # location section end
useShinyjs(),
div(id = "theQuestions",
# Input: Question1 ----
radioButtons(
inputId = "color",
"What's your favorite color?",
c("Red", "Blue", "Perriwinkle"),
selected = character(0)
),
actionButton(class = "btn btn-primary btn-lg", "submit", "Submit")
) %>% shinyjs::hidden() # theQuestions section end
) # col 8 inside questions row end
) %>% shinyjs::hidden(), # questions row end
fluidRow(id = "theEnd",
p("The end")
) %>% shinyjs::hidden() # theEnd row end
)
server <- function(input, output) {
# Hide section when next button clicked, show next section ----
observeEvent(input$welcomenext, {
shinyjs::hide("welcome")
shinyjs::toggle("questions")
})
observeEvent(input$locationnext, {
shinyjs::toggle("location")
toggle("theQuestions")
# runjs("window.scrollTo(0, 0)")
})
observeEvent(input$submit, {
shinyjs::toggle("questions")
toggle("theEnd")
runjs("window.scrollTo(0, 0)")
})
# Disable button if input missing ----
observe({
if (is.null(input$locationSelect) || input$locationSelect == "") {
shinyjs::disable("locationnext")
} else {
shinyjs::enable("locationnext")
}
})
observe({
if (is.null(input$color) || input$color == "") {
shinyjs::disable("submit")
} else {
shinyjs::enable("submit")
}
})
}
# Run the application
shinyApp(ui = ui, server = server)
相反,我有这样的想法:
actionButton(class="btn-lg", "submit", "Submit")
actionButton(type="button", class="btn-lg", "submit", "Submit")
您能否告知我们,您正在使用哪个版本的ShinyJS进行此测试?我注意到,一些旧版本的ShinyJS无法与IE正常工作。如果您使用任何旧版本的ShinyJS,您可以尝试使用最新版本更新它,以检查它是否有助于解决此问题。我们还建议采纳ShinyJS官方支持部门的建议,这可能有助于缩小问题的范围。我已经在IE上试用过你的代码,它对我来说运行良好。你可以按照@Deepak MSFT所说的更新ShinyJS包。看起来我已经在使用ShinyJS包和ShinyJS包的最新版本了。奇怪的是,我在我真正闪亮的应用程序上也有一个传单地图,它在Internet Explorer中呈现和反应都很好,它依赖JavaScript而不是shinyjs。我还可以做些什么来排除故障?我建议您向ShinyJS官方支持部门查询,因为从IE方面来看,我们没有任何关于ShinyJS应用程序任何已知问题的信息。您能否告知我们,您正在使用哪个版本的ShinyJS进行此测试?我注意到,一些旧版本的ShinyJS无法与IE正常工作。如果您使用任何旧版本的ShinyJS,您可以尝试使用最新版本更新它,以检查它是否有助于解决此问题。我们还建议采纳ShinyJS官方支持部门的建议,这可能有助于缩小问题的范围。我已经在IE上试用过你的代码,它对我来说运行良好。你可以按照@Deepak MSFT所说的更新ShinyJS包。看起来我已经在使用ShinyJS包和ShinyJS包的最新版本了。奇怪的是,我在我真正闪亮的应用程序上也有一个传单地图,它在Internet Explorer中呈现和反应都很好,它依赖JavaScript而不是shinyjs。我还可以做些什么来排除故障?我建议您向ShinyJS官方支持部门咨询,因为从IE方面来看,我们没有任何关于ShinyJS应用程序已知问题的信息。