Welcome Guest, Not a member yet? Register   Sign In
best practice: Where to store JS-files?
#1

I am using several JS/JQuery files in my views. Optimizing data tables or some AJAX calls for example.
Where do you recommend to store javascript files within the Codeigniter4 environment?
Reply
#2

If you are developing JS separately as a project (React, Ve, Vanilla), I would recommend using a separate folder at the ./frontend/ (./app/ level). And publish them after the build in ./public/
If these are small ready-made scripts, then ./public/{js,assets,css} is the right place
Simple CI 4 project for beginners codeigniter-expenses
Reply
#3

(This post was last modified: 12-06-2023, 11:59 PM by InsiteFX. Edit Reason: spelling error )

root
-- app
-- system
-- public -> or (public_html)
---- assets
------ css
------ js
------ img
------ images
------ plugins
-- etc;
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB