sendCustomMessage does not work properly in actionButton (Shiny)
<p>I am testing the script from here <a href="http://shiny.rstudio.com/articles/action-buttons.html" rel="nofollow">http://shiny.rstudio.com/articles/action-buttons.html</a> (see the section "Pattern 1 - Command").  </p>

<p>If to press the button "Click me" on the site so everything is Ok - we can see the popup menu.  </p>

<p>But if to copy the example script into new .R file and run it - no popup message appeared, no warning or errror message is generated (my brouser is Google Chrome). So I am stalled with it.</p>

<p><strong>The example script:</strong>  </p>

<pre><code>library(shiny)

ui &lt;- fluidPage(
  tags$head(tags$script(src = "message-handler.js")),
  actionButton("do", "Click Me")
)

server &lt;- function(input, output, session) {
  observeEvent(input$do, {
    session$sendCustomMessage(type = 'testmessage',
      message = 'Thank you for clicking')
  })
}

shinyApp(ui, server) 
</code></pre>