title: Load any kind of text from text file using jquery
body: <p>I was trying to load content/text of the div from the text file on the server at same location of the webpage and it is not working.</p>
  
  <p>Here is a code I have written to do this...</p>
  
  <p>HTML File</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $("button").click(function () {
                  alert('loading data');
                  $("#container").load("Content.txt");
              });
          });
      &lt;/script&gt;   
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="container"&gt;
          Test
      &lt;/div&gt;
  
      &lt;button&gt;Get External Content&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is a text file content : Content.txt</p>
  
  <pre><code>bla, bla bla bla etc etc
  </code></pre>
  
  <p>The div is not populating with the text file content... Any solution?</p>
  
  <p>Finally I put some valid HTML text into text file and it did work, but, in my case the text in the text file will be the code samples and I want to populate the code as text of div from text file on the server when page is loading.</p>
  
  <p>Any suggestion with code sample will be much appreciated. jQuery samples or JavaScript will be okay.</p>
  
  <p>Thanks &amp; Regards!!</p>