I am trying to reorganize my javascript into JS files and clear my js from my html ... The way I see it is the following: I really would like to get some input or any documentation / information confirming my plans - a little vague.
Basically, if I have a Home.htm file, I will also have a home.js file, note that they are called the same. Home.js will look like a loader for this page and will assign events (onclick, etc.) ...
I planned to do this with all the files, i.e. login.htm> login.js ...
I also thought of a global.js file that would be included in EVERY page that contains the elements needed in each file.
I also plan to have other js files that I plan to produce in the namespace so that my bootstrap files can call classes in this namespace to do things like date manipulations, etc. I know that JS is not a true OOP language, but I have some helper js that allow you to create namespaces and improve class structures.
Anyone have a better idea? Am I completely going in the wrong or right direction?
I would really like the input, I try to separate all my js from separate files, but I do not want to repeat myself, so I thought about creating these bootstrapper files to take care of everything for this page.
thanks
source
share