title: Read data in HTML object tag
body: <p>I have a text file stored on the server and an object in HTML like this:</p>
  
  <pre><code>&lt;object id="data" type="text/plain" data="test.txt"&gt;&lt;/object&gt;
  </code></pre>
  
  <p>How can I read the contents of <code>test.txt</code> in Javascript? What I have so far is:</p>
  
  <pre><code>var data = document.getElementByID("data");
  </code></pre>
  
  <p>But I can't figure out how to read the HTML document inside the object tag.</p>