title: jQuery: loading php files with .load
body: <p>Hey all, This is more of a standards and structure question.</p>
  
  <p>Consider this .load() scenario.  I have a page that loads a second page into a div with the .load() function.</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;My Page&lt;/title&gt;
  
  &lt;script type='text/javascript' src='myfunctions.js'&gt;&lt;/script&gt;
  
  &lt;head&gt;
  
  &lt;body&gt;
       &lt;a href='#' id='click_link'&gt;Click Me&lt;/a&gt;&lt;br&gt;
       &lt;div id='target_container&gt;
       &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Where myfunction.js holds a click routine, that when #click_link is clicked it loads a page into #target_container.  Now the page being loaded also needs access to myfunction.js.  I could load it again and this actually seems to work, or I could just put the javascript code that I need into the loaded page.  This seems to work too. </p>
  
  <p>My gripe, is that there has to be a better, more clean way of doing this.  Am I going about this wrong? Or it this the only way to do this.  I always thought javascript code should jailed inside <code>&lt;head&gt;&lt;/head&gt;</code> and be beaten viciously if it tried to live outside of it.  </p>
  
  <p>I saw several posts on this, but none have a clear explanation on if this is the best way to handle this problem.</p>
  
  <p>Please let me know.  ~ Thanks</p>