title: Ajax call to a local Phantom.js server from local js script
body: <p>I have set up an Apache server running locally that hosts my web application (written in ExtJs). I have also a secon local server made with phantom.js and listening on port 8080 :</p>
  
  <pre><code>var server, service;
  
  server = require('webserver').create();
  
  service = server.listen(8080, function (request, response) {
      response.statusCode = 200;
      response.write('&lt;html&gt;&lt;body&gt;Hello!&lt;/body&gt;&lt;/html&gt;');
      response.close();
  });
  </code></pre>
  
  <p>Now I'd like to do an Ajax request from my application to the phantom server :</p>
  
  <pre><code>Ext.Ajax.request({
      url: 'http://localhost:8080',
      method: 'GET',
      success: function(response){
          console.log('RESPONSE: ', response);
      },
      filure: function(response){
          console.log('failure: ', response);
      }
  });
  </code></pre>
  
  <p>But when running this script I'm getting :</p>
  
  <p><code>"NetworkError: 400 Bad Request - http://localhost:8080/?_dc=1336648497292"</code> in the console. Does this operation violate the same origin policy ? Or is it something else ? Going to localhost:8080 shows the proper response, so the server is running properly.</p>