0

Code below works fine in IE, but onsuccess(...) method is not getting called in Chrome. Does any one know the solution?

 $(document).ready(
 function (e) {
     $.support.cors = true;

    $.ajax({
     dataType: "JSON",
     type: "GET",
     crossDomain: true,
     url: "http://localhost:36730/home/GETaaa",
     success: function (data) {
         //console.log(data);
         alert(data);
     },
      Error: function (xhr, error, message) {
        alert(xhr);
     }

 });

 }

)
Jk1
  • 11,233
  • 9
  • 54
  • 64
AKB
  • 1
  • 1
  • can you post the content of GETaaa/a simplified version of it? Blind guess: you do not properly answer a cross domain request. – herrjeh42 Sep 20 '13 at 07:45
  • GETaaa is a method inside a WEP API service and returns a json result. public JsonResult GETaaa() { List storeNumbers = new List(); storeNumbers.Add("2"); storeNumbers.Add("3"); storeNumbers.Add("4"); return Json(storeNumbers, JsonRequestBehavior.AllowGet); } – AKB Sep 20 '13 at 08:05
  • I am not a .NET god, but this looks wrong to me. Check out http://stackoverflow.com/questions/758879/asp-net-mvc-returning-jsonp It's necessary because this is a JSONP call. – herrjeh42 Sep 20 '13 at 09:37

0 Answers0