title: NS_ERROR_FAILURE with JS XMLHttpRequest
body: <p>I'm trying to load the source of a web page, as shown in "Javascript:The Definitive Guide" p.481, using firefox.</p>
  
  <p>Here's my code: </p>
  
  <pre><code>  var request = new XMLHttpRequest();
  
    request.open("GET", "http://finance.yahoo.com/q?s=PG", false);
  
    request.send(null);
  
    if (request.status==200)  { alert(request.responseText);  }
  
    else {alert("Error "+request.status + ": "+request.statusText);} 
  
    &lt;/script&gt;  
  </code></pre>
  
  <p>Firebug shows the GET statement, followed by 200 OK X 338ms.</p>
  
  <p>Which looks like it was successful (code 200).</p>
  
  <p>But the next Firebug line says: NS_ERROR_FAILURE, request.send(null);, with no further explanation.</p>
  
  <p>and neither alert gets executed.</p>
  
  <p>It doesn't help if I use help mode, and doesn't run in Chrome either. I don't have a popup or cookie or ad blocker running.</p>
  
  <p>The page loads fine in perl with an LWP get().</p>
  
  <p>If this is an inevitable cross-domain taboo, why doesn't the "definitive guide" say so?</p>
  
  <p>I understand that JSONP returns JSON. I don't want that - I want just a string with the raw source, like with the perl LWP get().</p>
  
  <p>Is this impossible with Javascript?</p>
  
  <p>I suppose I could write a batch file which uses perl to get the source and put it into a JSON file whose name is hard-coded into the JS. But I'd like to avoid that sort of kludge.</p>