using htmlOutput when the HTML has script tags

I have dynamically generated html that I'm inserting into an shiny::htmlOutput input element (via renderText). I ran a couple of experiments and I don't believe that javascript included though tags is executed when the html is rendered. What is the best way to display the html and execute the javascript?

Try it with uiOutput() and renderUI() and make sure your dynamic HTML is wrapped inside an HTML() function.I'm not sure what you mean by "JavaScript included through tags," but I've successfully included JavaScript as HTML with a "script" tag that it wisely won't let me enter here. If that's what you mean, yep, that works.


1 Like

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.