I am trying to push a randomly generated string onto a textarea on UI. New to HTML/Shiny/JS but I know a few basics. 

My end goal is to use CodeMirror ([Whole download](http://codemirror.net/codemirror.zip)) or ShinyAce editor classes to add syntax highlighting to the textarea but I am unable to output strings from server into the textarea. I wish to push a certain R Code in `textStringToDisplay` and need syntax highlighting.

Please put the following files in the www folder of the app.R:

1. [codemirror.css](https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.css)
2. [cobalt.css](https://github.com/codemirror/CodeMirror/blob/master/theme/cobalt.css)
3. codemirror.js (I could not find
 this file on GitHub, please use the download link above, extract and
 look in the lib folder)
4. [r.js](https://github.com/codemirror/CodeMirror/blob/master/mode/r/r.js)

Please let me know if you need more information or if I should rephrase any parts of this. Thanks in advance.

```
library(shiny)

if (interactive()) {

  ui <- shinyUI(
    fluidPage(
      tags$head(tags$title("Title"),
                tags$link(rel = "stylesheet", href = "codemirror.css"),
                tags$link(rel = "stylesheet", href = "cobalt.css"),
                tags$script(src = "codemirror.js"),
                tags$script(src = "r.js")
      ),
      tags$textarea(id="textBox", name = "Feedback", textOutput(outputId = "textStringToDisplay")),
      tags$script(
        'var editorR = CodeMirror.fromTextArea(textBox, {
        mode: "r",
        lineNumbers: true,
        smartindent: true
});
        editorR.setOption("theme", "cobalt");
        editorR.setSize("50%","100%");')))

  server <- function(input, output){
    output$textStringToDisplay <- renderText(paste0(sample(letters,15),collapse = ""))
  }

  shinyApp(ui = ui, server = server)
}

```