Last active
August 17, 2020 14:17
-
-
Save ColinFay/346695677c92e2158b2bf6ac56529c62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
ui <- function(request){ | |
tagList( | |
tags$script( | |
"$(document).on('shiny:connected', function(event) {", | |
"Shiny.setInputValue('location', document.location)", | |
"})" | |
), | |
verbatimTextOutput("wherami") | |
) | |
} | |
server <- function( | |
input, | |
output, | |
session | |
){ | |
output$wherami <- renderPrint({ | |
print(input$location) | |
}) | |
} | |
shinyApp(ui, server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment