Page 1 of 1

Javascript

Posted: Mon Sep 22, 2025 4:24 pm
by dio2
Hello,

I include a javascript file in the theme in the header.tpl adding this line:

<script nonce="{$smarty.const.RANDOM_HEX}" src="{$flatpress.themeurl}js/myscripts.js"></script>

In the file are two functions for a onclick event to show a dropdown menu.

It is working fine locally on localhost but not online on the webserver, and I can not understand the reason. Do you have any idea what causes that problem?

Re: Javascript

Posted: Thu Oct 02, 2025 7:10 pm
by fraenkiman
Hello dio2,

What appears as HTML output in the browser (Ctrl+U)? Are any warnings or errors displayed in the browser developer tools -> console?

Please post the contents of your myscripts.js file here in the code block.

Best regards,
Frank