It is always recommended to avoid inline Javascript codes by putting all codes in a JS file, which is included in all pages. I wonder, if this does not cause pe
Avoiding inline js is not performance based...but its more about maintainability and separating the presentation layer(html) from the controller layer(js).
Having inline js on different pages will make it difficult to maintain for you and others as the project scale increases.
Moreover using separate js files you can encourage reusability and modular code design.
keeps your html clean and you know where to look when any js error occurs instead of multiple templates.