It is possible to have scripts tags in child pages and to be rendered by Django whey they (child pages are loaded / showed)?
I have a mobile web app which has this structure
ROOT
--PAGE1 (here I'd like to have the script rendered by Django)
--PAGE2
--PAGE3
--PAGE4
The reason is because on the second page I have custom controls like: flip switch, buttons, etc. that will do something specific on that page.
Code snippets:
//This one gets rendered only when root page is loaded
jQuery(document).ready(function($) {
//But the control / html element its on the second page
$("#myswitch").change(function() {
console.log("Switch changed!");
});
});