jQuery Ajax GET doesn't work on Chrome

jQuery Ajax GET doesn't work on Chrome

Hello,

I'm experimenting some problems with ajax calls on Chrome (In all other browser it works perfectly).

This is the jQuery code:

  1. $(document).ready(function() {
  2.       $.ajaxSetup({ cache: true });
  3.       call();
  4. });

  5. function call() {
  6. jQuery.ajax({url : webappUrl+'/en/map/statuses/'+community_id,
  7. type : 'get',
  8. dataType: 'json',
  9. async: true
  10. })
  11. .done(function(data){
  12. for(var i = 0; i < data.length; i++) {
  13. if(data[i].status ==1){
  14. inlay = {"id":data[i].geometry_id,"t":"#red"};
  15. mapDataObject.addInlay(inlay);
  16. inlayarray[data[i].geometry_id] = new Array();
  17. inlayarray[data[i].geometry_id]["aid"] = inlay.aid;
  18. inlayarray[data[i].geometry_id]["status"] = data[i].status;
  19. }
  20. if(data[i].status ==0){
  21. inlay = {"id":data[i].geometry_id,"t":"#green"};
  22. mapDataObject.addInlay(inlay);
  23. inlayarray[data[i].geometry_id] = new Array();
  24. inlayarray[data[i].geometry_id]["aid"] = inlay.aid;
  25. inlayarray[data[i].geometry_id]["status"] = data[i].status;
  26. }
  27. if(data[i].status ==4){
  28. inlay = {"id":data[i].geometry_id,"t":"#grey"};
  29. mapDataObject.addInlay(inlay);
  30. inlayarray[data[i].geometry_id] = new Array();
  31. inlayarray[data[i].geometry_id]["aid"] = inlay.aid;
  32. inlayarray[data[i].geometry_id]["status"] = data[i].status;
  33. }
  34. if(data[i].status ==5){
  35. inlay = {"id":data[i].geometry_id,"t":"#white"};
  36. mapDataObject.addInlay(inlay);
  37. inlayarray[data[i].geometry_id] = new Array();
  38. inlayarray[data[i].geometry_id]["aid"] = inlay.aid;
  39. inlayarray[data[i].geometry_id]["status"] = data[i].status;
  40. }
  41. };
  42. MapRefresh = setInterval('update()', 1000);
  43. })
  44. .fail(function(e){
  45. console.log(e);
  46. onMapChanged();
  47. });
  48. }

This is the error object I get in Chrome:

Object {readyState0getResponseHeaderfunctiongetAllResponseHeadersfunctionsetRequestHeaderfunctionoverrideMimeTypefunction}
  1. abortfunction (e){var t=e||w;return u&&u.abort(t),k(0,t),this}
  2. alwaysfunction (){return i.done(arguments).fail(arguments),this}
  3. completefunction (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}
  4. donefunction (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}
  5. errorfunction (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}
  6. failfunction (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}
  7. getAllResponseHeadersfunction (){return 2===b?a:null}
  8. getResponseHeaderfunction (e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t}
    1. argumentsnull
    2. callernull
    3. length1
    4. name""
    5. prototypeObject
    6. __proto__function Empty() {}
    7. <function scope>
  9. overrideMimeTypefunction (e){return b||(p.mimeType=e),this}
  10. pipefunction (){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()}
  11. progressfunction (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}
  12. promisefunction (e){return null!=e?x.extend(e,r):r}
  13. readyState0
  14. responseText""
  15. setRequestHeaderfunction (e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this}
  16. statefunction (){return n}
  17. status0
  18. statusCodefunction (e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this}
  19. statusText"error"
  20. successfunction (){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this}
  21. thenfunction (){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()}
  22. __proto__Object



In the Javascript Console at the Network Tab I can't see the ajax request. 
It seems that Chrome trigger the error before the request is sent.

I can assure that the ajax request is not cross domain.

Please help me I'm getting mad with this! :(

Thank you!