title: read 2 text files with javascript
body: <p>i can't get javascript to load 2 text files with regular script or query and i need help, plz give and answer?</p>
  
  <p>heres with jquery,</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  setTimeout(function(){
     window.location.reload(1);
  }, 1000);
  &lt;/script&gt;
  &lt;script language="javascript" src="file:///Users/trevor/Desktop/jquery.js" &gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  jQuery.get('file:///Users/trevor/Desktop/x.txt', function(data) {
      document.getElementById('xp').innerHTML = data;
  });
  &lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  jQuery.get('file:///Users/trevor/Desktop/y.txt', function(data) {
      document.getElementById('xp').innerHTML = data;
  });
  &lt;/script&gt;
  &lt;p id="xp"&gt;hi&lt;/p&gt;
  &lt;br&gt;
  &lt;p id="yp"&gt;hi&lt;/p&gt;
  </code></pre>
  
  <p>and without,</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var client = new XMLHttpRequest();
  client.open('GET', 'file:///Users/trevor/Desktop/x.txt');
  client.onreadystatechange = function() {
    document.getElementById('xp').innerHTML = client.responseText;
  }
  client.send();
  &lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  var client = new XMLHttpRequest();
  client.open('GET', 'file:///Users/trevor/Desktop/y.txt');
  client.onreadystatechange = function() {
    document.getElementById('yp').innerHTML = client.responseText;
  }
  client.send();
  &lt;/script&gt;
  </code></pre>
  
  <p>and possibly...</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var x = document.getElementById('x').contentWindow.getElementById('xp').innerHTML
  
  var y = document.getElementById('y').contentWindow.getElementById('yp').innerHTML
  
  function updatex(){document.getElementById(xp).innerHTML = x}
  
  function updatey(){document.getElementById(yp).innerHTML = y}
  
  setInterval( "updatex(); document.getElementById('x').contentWindow.location.reload();", 1000 );
  
  setInterval( "updatey(); document.getElementById('y').contentWindow.location.reload();", 1000 );
  
  
  &lt;/script&gt;
  &lt;p id="xp"&gt;hi&lt;/p&gt;
  &lt;br&gt;
  &lt;p id="yp"&gt;hi&lt;/p&gt;
  
  &lt;iframe id="x" src="file:///Users/trevor/Desktop/x.txt"&gt;&lt;/iframe&gt;
  
  &lt;iframe id="y" src="file:///Users/trevor/Desktop/y.txt"&gt;&lt;/iframe&gt;  
  </code></pre>