Nowdays, i create a .js file with a lot of functions and then I link it to my html pages. That\'s working but I want to know what\'s the best way (good practices) to insert js i
The best way is to create a new scope and execute your code there.
(function(){ //code here })();
This is best used when the global scope is accessed at a minimum.
Basically, this defines an anonymous function, gives it a new scope, and calls it.