0
I’m fiddling with a panel of a website that has two JS functions at the bottom of the page that will only be used on a page that will open in a modal.
On this site there is also a file dedicated only to scripts.
I wonder if there is any problem I put these two functions only on this page because I will only use these functions in it, or I have to ALWAYS put in the file . js regardless if I will use only on one page.
I ask because they always tell me to put all the JS in this file, however, I THINK (I don’t know if it’s right) that there is no need to pollute more and more a file by putting a function that I will only use on a page throughout the site.
What is the ideal shape?