Is it a good practices to separate JS file based on pages?
<p>For example, there are three different pages in my website which will use different js code and some common js code.</p>

<p>Is it a good practices to separate these js code into different files?</p>

<p>For example, in A.html:</p>

<pre><code>&lt;script src="/js/common.js"&gt;&lt;/script&gt;
&lt;script src="/js/pageA.js"&gt;&lt;/script&gt;
</code></pre>

<p>in B.html:</p>

<pre><code>&lt;script src="/js/common.js"&gt;&lt;/script&gt;
&lt;script src="/js/pageB.js"&gt;&lt;/script&gt;
</code></pre>

<p>So, when I access page A, page B related js will not be loaded, so it will be more quick I think? Am I thinking too much? its not necessary?</p>

<p>Or should I just put all js in one js file?</p>

<p>For example, in every html file:</p>

<pre><code>&lt;script src="/js/main.js"&gt;&lt;/script&gt;
</code></pre>

<p>Normally which way do people do ?</p>