title: Ajax request fails, can't see why
body: <p>I've created an API that returns data in json, and now I'm creating an app to test the API by receive the data and use it on the page. However, my ajax code (se below) fails by some reason, and the error says just "error" (Error: error).</p>
  
  <p>What can be wrong with the code?</p>
  
  <p><strong>the code:</strong></p>
  
  <pre><code>    $.ajaxSetup ({
        url: "http://localhost:8000/products", // &lt;--- returns json
        type: "GET",
        headers:{
          "Accept":"application/json",
          "Content-type":"application/x-www-form-urlencoded"
        }
      })
      $.ajax({
          success: function(data){
              console.log("You made it!");
          },
          error: function(xhr) {
             console.log("Error: " + xhr.statusText);
         }
      }).done(function(data){
          console.log(data);
      })
  </code></pre>
  
  <p>This is the info I get in Chrome (Inspector -> Network):</p>
  
  <p><strong>Name:</strong> products localhost/, <strong>Method:</strong> GET, <strong>Status:</strong> (cancelled), <strong>Type:</strong> Pending, <strong>Initiator:</strong> jquery-latest.js:8434 Script, <strong>Size:</strong> 13B 0B, <strong>Time:</strong> 95ms 0.0 days</p>