Answer the question
In order to leave comments, you need to log in
How to include (architecturally use) JS code in a laravel 5.1 project?
Are there any recommendations or best practices for using JS code in a project?
For example, there is a laravel 5.1 project that uses JQuery. Each page uses js-actions, one or another UI element. (click, ajax, etc...).
Now there is a common core.js - a file that is connected and executed on each page.
I do not like:
Answer the question
In order to leave comments, you need to log in
The standard practice is 1 file with all common libraries, 1 file with the general code of a section (a directory, for example) and 1 file with a specific page code.
This allows you to flexibly manage caching and not load too much.
There may not be a file for the page if all standard elements are initialized in the section code.
Try https://github.com/tabuna/ui-load
Allows you to load on the page only what is needed, be it js or css.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question