Can javascript code, in a page returned by ajax, call a function that was in a js file of the original page using jquery
<p>I have something similar to this:</p>

<pre><code>&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;JQuery Test&lt;/title&gt;  
    &lt;script type="text/javascript" src="js/jquery-1.5.1.min.js"&gt;&lt;/script&gt;   
    &lt;script type="text/javascript" src="js/page.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div id="searchResults" &gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The searchResults div will get populated by a jQuery .load(). The result that is returned into the div has javascript to be executed. This much works fine.</p>

<p>Now I need some of the javascript that gets returned into searchResults to call a function in page.js. This currently does not work. Is this possible?</p>

<p><strong>UPDATE:</strong></p>

<p>I sort of found the problem. In page.js the function I am trying to call is inside a $(document).ready statement. If declare the function outside of the document ready it works. Anyone care to explain to me why this is and is there a way to leave it in the document ready area?</p>
