title: "Uncaught TypeError: Cannot read property 'toLowerCase' of undefined" on jsonp request
body: <p>I have a node server and an application from another server doing a AJAX jsonp request via jquery to get a json array of parameters, but when i request the data the jquery throws this error:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'toLowerCase' of undefined 
  </code></pre>
  
  <p>The request is sent and i get the response, but i can't get the data in the javascript client-side</p>
  
  <p>Node server:</p>
  
  <pre><code>var my_http = require('http');
  
  
  var databaseUrl = "leitordecarga"; // "username:password@example.com/mydb"
  var collections = ["tables"]
  var db = require("mongojs").connect(databaseUrl, collections);
  
  var callback = [];
  db.tables.find(function(err,values){
      if(err || !values){
          console.log('error');
      }else{
          values.forEach(function(value){
              callback.push(value);
          });
      }
  });
  
  
  my_http = require("http");  
  my_http.createServer(function(request,response){  
      response.writeHeader(200, {"Content-Type": "application/json"});  
      response.write(JSON.stringify(callback));  
      response.end();  
  }).listen(8080); 
  </code></pre>
  
  <p>Javascript in client-side:</p>
  
  <pre><code>$(document).ready(function(){
      $.ajax({
          url:'http://localhost:8080/mongo.js',
          dataType:'jsonp',
          type: "GET",
          jsonp : "callback",
          contentType: "application/jsonp",
          success: function(data){
              console.log(data);
          },
          error: function(data){
              console.log(data.getResponseHeader());
          }
      }).done(function( data ) {
          console.log(data);
      });
  }); 
  </code></pre>
  
  <p>im using jquery 2.1.0 but i've tried other versions and the error persists</p>
  
  <p>My question is how i can get the data in the success clause</p>