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. ...

Get Learning Shiny now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.