Need help on Routing: Unable to run script on content page

Hi, just want to run inline script on my content page. However, I found out that the script doesn’t work on the content page. Just try out simple script as follows. I also tried external script and found out it doesn’t work as well. I’ve also tried to include script from CDN but still unable to get the script to work.

<script>
$(document).ready(function(){
  $("p").click(function(){
    alert("The paragraph was clicked.");
  });
});
</script>

What I might have missed and how actually can I run inline script and 3rd party script from my routing content page?

Are you simply trying to show an alert when a paragraph is clicked on?

If so, you don’t need a custom script. You can do it with Wappler very easily. I’m on my phone right now so can’t provide screenshots but if you have more issues I can when I get to work.

No, that’s just an example. I need to run custom codes and 3rd party scripts etc… Now even the simplest code doesn’t work. The issue here is that javascript does not work from routing page.

Dealing with this now unfortunately. Driving me nuts trying to show and hide a simple loading overlay.

I think you need to add a page flow, and inside of it under execute add Run Javascript.
Set your click event to to call that flow’s run command.

I think.
See: Can we execute a custom script function in Wappler?

Disclaimer I’ve not yet dove into app flow and page flow yet. So there’s that.

I will give that a try, thank you. Separate now cause this simple thing is holding up a lot.