O'Reilly logo

Learning Shiny by Hernán G. Resnizky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Relating HTML/JavaScript and server.R

As it was mentioned earlier, one of the biggest advantages of customizing the application UI by just adding tags to UI.R becomes even more visible when the user interface elements (HTML, JavaScript, and so on) depend on reactive values too. This case of reactivity is definitely different from the ones seen so far as the output should be included as HTML code, especially when it comes to JavaScript. For this kind of situation, session$sendCustomMessage() along with a built-in JavaScript function, Shiny.addCustomMessageHandler(), have to be used.

Basically, the first function sends a message to the user interface that will be based on reactive inputs. The second function listens to this and acts accordingly. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required