I've been trying to find the best way to load a list of javascript files in my code igniter (CI) project.
The problem I have is that I have a large amount of CI views, with each view having a distinct list of javascript resources that need to be loaded for the view to function correctly.
How can I load the required resources for a specific view easily?
The two methods I am contemplating using are:
Load every resource every time - I am hesitant to use this method as it will unnecessarily increase load times for resources that are not required.
Create a (massive) switch statement that defines the list of files required for each page. However, I am hesitant to using this method as it is difficult to maintain
Are there any native functions to CI, or 3rd party tools that I can use to better solve my problem?
Kind Regards Jordan