2014-09-24 38 views
0

我遇到了兩個客戶的一個奇怪的問題。前端無法發送POST/GET請求insige Angular指令。AngularJS發佈失敗,jQuery ajax也失敗。沒有CORS

線:

xhr.open(method, url, true); 

Ecception:

Exception { message: "", result: 2153644038, name: "", filename: "http://site.ru/scripts/vendor/angular.js", lineNumber: 8327, columnNumber: 0, inner: null, data: null } 

這是通常的請求相同的域,沒有CORS。

這個問題只在客戶端(現在有2個客戶面臨這個麻煩,第一個Win 8.1 + Firefox的最新和第二個Win 7 + Chrome最新)轉載。

我不能在我身邊重現這個問題。但我在客戶前端看到錯誤。

請求從頁:[。]咕GL/T2d2oh
API: 「/用戶/ getAds」

失敗回調調用一個請求:

var jqueryRequest = $.ajax({ 
    type: "POST", 
    url: $scope.url, 
    data: JSON.stringify(params), 
    dataType: 'json', 
    contentType: "application/json; charset=utf-8", 
    beforeSend: function(xhr) { 
     xhr.setRequestHeader('Authorization', 'Bearer ' + token); 
    } 
}); 

jqueryRequest.done(function(data, status) { 

    /* Do smth */ 
    $scope.$apply(); 
}); 

jqueryRequest.fail(function(jqXHR, status, error) { 
    /* Do smth */ 
    console.error("pagination error", jqXHR, status, error); 
    $scope.$apply(); 
}); 

相同with angular post:

$http.post($scope.url, params).success(function(data, status, headers, config) { 
    /* Do smth */ 
}).error(function(data, status, headers, config) { 
    console.error('pagination:error', status, config); 
}) 

異常......「」nsresult:「0x805 E0006() 「位置: 」JS幀:: http://site.ru/scripts/vendor/angular.js :: createHttpBackend/< ::線路8494「 的數據:沒有

+0

這不是質量問題。請發佈更多的代碼和什麼適當的錯誤細節... – 2014-09-24 08:21:34

+0

我發佈了更多的代碼。但我無法獲得任何錯誤細節,只有例外。 – 2014-09-24 08:33:53

回答

4

SOLUTION

重命名從API請求補丁 」/用戶/ getAds「 到」/用戶/ getObjects「以避免阻止來自的廣告攔截器應用程序。