Organize javascript code based on page
Hi I'm relatively new to javascript development. At the moment, I have one javascript file with a lot of small pieces of code that are called in another part of the website. For example, I have an event handler for some google map stuff that is only called on one individual page, I have some validation stuff for my contact page, etc. My question is - what is the best way to organize this code - given that each page only requires very small code, but its different and specific to the page?
Oh, I'm using jquery if it matters.
+2
a source to share
1 answer