Including Jquery or similar files, should it be conditional?
<p>Simple and fast question:</p>

<p>I need the jquery library for a site, so I access it in my header.php file as such:</p>

<pre><code>&lt;head&gt;
    &lt;!-- include jQuery library --&gt;
    &lt;script type="text/javascript" src="../javascript/jquery.js"&gt;&lt;/script&gt;
&lt;/head&gt;
</code></pre>

<p>Now my question is should I also be putting some other php scripting in there to make sure it is only included when I need it for a given page? My gut tells me I am absolutely right to only load the jquery files when I need them, yet I swear I always see things like this loaded without thought to if they are actually needed for the given situation. So perhaps there is no harm in always having it there.</p>

<p>So should it be like this?? Pseudo code:</p>

<pre><code>&lt;head&gt;
        &lt;?php 
           //set jquery variable to true or false in configure.php file based on situation
           if($jquery){
           //include the jquery script!!
           }
            else{
           //jquery??? we don't need that here
           } 
        ?&gt;


 &lt;/head&gt;
</code></pre>
