How to properly initialize custom javascript for ui elements #2350
Replies: 1 comment 2 replies
-
Hi @GeorgeZard, Thanks for trying out FluentCMS. We have same issue for javascript too. and didn't found a good solution for this problem yet. the feel free to open discussions and issues when you have questions & suggestions. You can join our discord if you like (https://discord.gg/WyqYuC6YbY) |
Beta Was this translation helpful? Give feedback.
-
Hello and a delayed Happy New Year!
I have finished writing my own HTML template to add as separate code blocks for simple ui stuff like hero pages and etc. etc.
And i have hit a certain curious block.
Technical Question
I'm seeking guidance on how to properly initialize custom javascript code that i have created for simple ui interaction like loadingbars and some canvas elements.
The main problem i am hit with is that currently i load my scripts inside the layout pages (MainLayout and EditLayouts) in order to get them somehow working but only for a moment. The code block ui works properly for a while then after a micro refresh the scripts are completely dead.
Showcase of Problem
You can see the javascript working as intended and then with a microrefresh it get's broken.
![javascript_refresh](https://private-user-images.githubusercontent.com/17571482/410055335-0d759db5-5f2b-4e06-8e83-2ea4175218a8.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODQzODcsIm5iZiI6MTczOTY4NDA4NywicGF0aCI6Ii8xNzU3MTQ4Mi80MTAwNTUzMzUtMGQ3NTlkYjUtNWYyYi00ZTA2LThlODMtMmVhNDE3NTIxOGE4LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDA1MzQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ1ZTYyYjMyYTIxOTU0NDZiMjBkZjEyOTM5OTZiM2M1ZWE3YTcwZDk1NTkwMzA2ZTI3MTQ0YjUzMjkxYjExODUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.yhMUradlBxWddQIJgjqhNAv1ZShIAVVTmt1t5q_3eSs)
Can somoene help?
I can gladly provide anything needed to further help with understanding the probelm
I'm still in the learning phase of understanding the system's complete functionality, and I appreciate your patience as I work through this process.
Thank you again for your continued support, and please maintain this excellent level of work!
Beta Was this translation helpful? Give feedback.
All reactions