What are the advantages to putting your Javascript in a .php file?
<p>I occasionally come across pages where some Javascript is included via a PHP file:</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;script type="text/javascript" src="fake_js.php"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="handleLoad();"&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>where the contents of <strong>fake_js.php</strong> might look something like this:</p>

<pre><code>&lt;?php header('Content-type:  text/javascript') ?&gt;

function handleLoad() {
    alert('I loaded');
}
</code></pre>

<p>What are the advantages (or disadvantages) to including Javascript like this?</p>
