how can i use custom.js
i create it in folder js and i put the code but it not used at all.
https://alainperron.ca
joomla 6.1
last version for other extensionsand admin tools pro
Shaper helix ultimate
Accepted answer
Marked as the solutionHi Alain,
Thanks for reaching out to us.
If your custom.js is not being applied, please note that simply placing the file inside the /js folder is not enough — Joomla won’t load it automatically.
You can use one of the following solutions:
Option 1: Load custom.js via your template (index.php)
Add the script using Joomla’s Web Asset Manager in your template’s index.php file before the closing </body> tag:
$wa = $this->getWebAssetManager();
$wa->registerAndUseScript('custom', 'templates/your_template/js/custom.js');
Alternatively, you can include it directly:
<script src="/templates/your_template/js/custom.js"></script>
Option 2: Use Template Styles → Custom JavaScript
If your template provides a Custom JavaScript field, you can paste your JS code there. This ensures the script is loaded across your site without modifying files.
After making changes, please clear your Joomla cache and browser cache.
Let us know if it still doesn’t work 👍
Thanks
5 more replies
Thank you very much again. I will test the option 2 later and it does not work, I will update this ticket.
I just pasted the code after carefully checking all the elements in my CSS and JavaScript.
I used the custom code window on the homepage with options and custom code - javascript - for Helix Ultimate 2.2.5, but I'm still getting the same vague errors: 'error undefined' two times.
as first step, just create custom.js file and upload to /templates/THEME-NAME/js/ and check if on front-end source that file is loaded. In theory should be, if not add link to it.
Could you please share temporary administrator access to your Joomla backend? You can provide the credentials securely in the hidden content section. Also, please take a full backup of your site before we make any changes.
Once I have access, I’ll investigate further and see what’s causing the issue. Let me know once you’ve shared the details!
Best regards,
I create a new ticket with many more details.