title: Get text file contents using JQuery in an external file
body: <p>I have an external javascript file that I want to use to collect the contents of a number of text files. JQuery .get() seems the most obvious choice. I can make this work if the JQuery is in the page, but not when the JQuery is in the external file. I'm missing something hugely simple...and I am currently mixing normal javascript with JQuery in the same file which I fear is poor form.</p>
  
  <p>All files I am trying to access are within the same file structure. Currently I have the following in my external .js:</p>
  
  <pre><code>function addPanels() {
      // eventually loop over list of local HTML files
      // and do some stuff with the results...
      fileContents = readHTMLFile();
  }
  
  jQuery(function($){
      readHTMLFile = $.get('../html/test.html', function(data) {
          alert('Loaded something');
          return(data);
      });
  });
  </code></pre>
  
  <p>My HTML page contains the following:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          addPanels();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Pretty sure this is a RTFM moment so direction towards the right manual/tutorial would be great!</p>
  
  <p>Dan</p>