title: Empty responseText from XMLHttpRequest
body: <p>I have written an XMLHttpRequest which runs fine but returns an empty responseText.</p>
  
  <p>The javascript is as follows:</p>
  
  <pre><code>  var anUrl = "http://api.xxx.com/rates/csv/rates.txt";
    var myRequest = new XMLHttpRequest();
  
    callAjax(anUrl);
  
    function callAjax(url) {
       myRequest.open("GET", url, true);
       myRequest.onreadystatechange = responseAjax;
                   myRequest.setRequestHeader("Cache-Control", "no-cache");
       myRequest.send(null);
    }
  
    function responseAjax() {
       if(myRequest.readyState == 4) {
          if(myRequest.status == 200) {
              result = myRequest.responseText;
              alert(result);
              alert("we made it");
          } else {
              alert( " An error has occurred: " + myRequest.statusText);
          }
       }
    }
  </code></pre>
  
  <p>The code runs fine. I can walk through and I get the readyState == 4 and a status == 200 but the responseText is always blank.</p>
  
  <p>I am getting a log error (in Safari debug) of Error dispatching: getProperties which I cannot seem to find reference to. </p>
  
  <p>I have run the code in Safari and Firefox both locally and on a remote server.</p>
  
  <p>The URL when put into a browser will return the string and give a status code of 200.</p>
  
  <p>I wrote similar code to the same URL in a Mac Widget which runs fine, but the same code in a browser never returns a result.</p>