title: Ajax call returns undefined data
body: <p>I have an ajax call that requests data from an MVC controller method. <br>
  I am returning a Json result from the controller.<br><br>
  Ajax request completes, but the data returned is undefined.<br><br><em>Ajax Call</em><br></p>
  
  <pre><code>var param = {
      "username": uname,
      "password": pass
  };
  var serviceURL = "/Account/CheckUser";
  
  var req = $.ajax({
      url: serviceURL,
      type: "POST",
  
      data: JSON.stringify(param),
  
      contentType: "application/json",
  
      complete: successFunc,
      error: errorFunc
  });
  
  function successFunc(data) {
      if (data.exists == true) {
          console.log("Completed : " + data.exists);
      } else {
          console.log("Failed : " + data.exists);
  
      }
  }
  </code></pre>
  
  <p><br><em>Controller Method</em> <br></p>
  
  <pre><code>[HttpPost]
  public JsonResult CheckUser(string uname, string pass)
  {
      Boolean cont = true;
      return Json(new { exists = cont });
  }
  </code></pre>
  
  <p><br><br>
  Can anyone tell me why <code>exists</code> returns as undefined? <br><br><strong>UPDATE</strong>
  <br>
  As suggested below, I wrote the data to the console, and it seems it's returning an empty string. So I guess the question should be more '<strong>Why is the data returning empty?</strong></p>