Answer the question
In order to leave comments, you need to log in
How to organize client js code?
There is a working web-project. Js code lies in several files that contain functions. The logic is spread over html templates. Decided to clean up. First of all, take out all the js code in files, wrap everything in modules. Which is exactly what was done. There is a desire to collect all modules-files into one, maximum two files, for connection on the site.
The question is how to properly organize the execution of logic. Generate for each page, section of the site, its own js file, which contains all the js initialization code for the necessary modules. Or make one file in which to write a handler that will initialize modules based on the specified conditions.
I hope I didn't explain too confusingly.
Thanks for the help.
Answer the question
In order to leave comments, you need to log in
Thanks for answers.
But I have a logical block. There is an understanding of how to write an application with a single entry point on the same backbone, I mean that there is an index.html in which myApp is initialized. But in my case, there is a working classic web project, where there are different pages on which you need to execute your js. And here is a stupor, how to optimally organize, convenient work with js.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question