2 ms·
Looks useful! I skimmed through the docs and had a question. Is there a mechanism for loading HTML partials that require additional style or script file? And p
by lioeters 8mo ago
Looks useful! I skimmed through the docs and had a question.
Is there a mechanism for loading HTML partials that require additional style or script file? And possibly a way to trigger a JS action when loaded? For example, loading an image gallery.
- amaury_bouchard 8mo agoYes! `<script>` and `<style>` tags found in the fetched content are processed on the fly, as long as they haven't been loaded already. So you can include a gallery-specific stylesheet or script directly in the partial, and µJS will inject and execute them automatically. For triggering a JS action after rendering, the `mu:after-render` event is the right hook.
- lioeters 8mo agoI see, simple! Thanks, I look forward to exploring uJS further.