Javascript

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
dio2
Posts: 2
Joined: Mon Sep 22, 2025 4:03 pm

Javascript

Post by dio2 » Mon Sep 22, 2025 4:24 pm

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?

User avatar
fraenkiman
Posts: 368
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Javascript

Post by fraenkiman » Thu Oct 02, 2025 7:10 pm

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
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest