call function from external js (php) file
<p>I have a file where I keep all scripts so my pages wouldn't get messy (I have php file which generates required javascript).
My includes basically look like this:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="script.php"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;input type="button" onClick="return blah();" /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>script.php</p>

<pre><code>&lt;?php
    header("content-type: application/x-javascript");   
?&gt;

    function blah()
    {
        alert("blah");
    }

    $(document).ready(function() 
    {});
</code></pre>

<p>In script.php there's jquery wrapper $(document).ready where I keep all jquery related stuff. The funny thing is, when I put function blah() inside this wrapper I get "blah is not defined" error, but when I put it outside - works perfectly. So, what could be the problem?</p>
