In our project, we use a webservice via Ajax which returns content which was rendered from a mustache template by the output renderer (extended plugin_renderer_base).
The problem is: The mustache templated includes javascript via the normal js tags. But when the result from the renderer is passed back via Ajax, this javascript inclusion is lost.
Is there a Moodle way to render for Ajax and pass back supplementary javascript after the page is loaded? Or how would you achieve this?