title: junk after document element Firefox Error Loading Content With JQuery Get
body: <p>I have a page (which is unfortunately behind a login system), which basically has a nav bar down the left of a list of articles, and when you click on an article, it loads the content from a .inc file stored on the server, using a provided file path. </p>
  
  <p>This works fine on Google Chrome. </p>
  
  <p>However, on Firefox, when the page loads, I get this weird javascript error: </p>
  
  <p>"junk after document element" - When I click the error, it takes me to line 2 of the content from the first article being loaded. </p>
  
  <p>Let me show you some code. </p>
  
  <p>This is the last JS function which is run when the page has finished loading, and it's purpose is to load the initial article. </p>
  
  <pre><code>function initialise_family_center_page() 
  {
      if (current_element_id == "" || current_element_id == "family_center_general_info") //If this is the first article to be loaded
      {
          //Get the file path of the inc file to load
  
          var content_directory = file path....;
  
          jQuery.get(content_directory, function(data) 
          {
              $('#family_center_main_content').html(data);    //Load the content
          }); 
      }   
  }
  </code></pre>
  
  <p>The content in the .inc file being loaded is as follows: </p>
  
  <pre><code>&lt;p&gt;Some text&lt;/p&gt;
  
  &lt;p&gt;Some text&lt;/p&gt;
  </code></pre>
  
  <p>It's worth mentioning at this point, that in Chrome and Firefox, the content loads. However in firefox, because of the JS error, you can no longer use the rest of the page because the JS has stopped working. </p>
  
  <p>Interesting point, which I discovered from googling the problem, is if I change the content of the file to:</p>
  
  <pre><code>&lt;html&gt;
      &lt;p&gt;Some Text&lt;/p&gt;
  
      &lt;p&gt;Some Text&lt;/p&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Then the error does not appear and the page works (until you load the next content file without the  tags. </p>
  
  <p>However, this is not a suitable fix because there are thousands and thousands of files. </p>
  
  <p>Can anyone help?</p>