PHP if statement if the page was loaded with ajax
<p>I have a page that loads with a div populated from an include file (pullList.php), but if you click a button (let's say a "re-load" button) the content of the div is reloaded with that same file (pullList.php).</p>

<p>The problem now is that when the page is loaded via ajax (with jquery) I need an include file (function.php) inside the pullList.php file which is already included on the page. </p>

<p>So, ideally I'd like to be able to write a statement that says </p>

<pre><code>if(the page was loaded with ajax) {
       include(function.php);
}
</code></pre>

<p>That way the function.php file will only be loaded once, and if the page is requested again via ajax, it has the right functions to display the content properly.</p>

<p>I've tried using include_once, but didn't work - had the same problem. Any suggestions?</p>

<p>Thanks!</p>
