Reputation: 692
I faced with a strange problem with two customers. Frontend is unable to send POST/GET request insige Angular directive.
Line:
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 }
This is is usual request to the same domain, no CORS.
This problem reproduced only on a customer side (now 2 customers faced this trouble, first Win 8.1 + Firefox Latest and the second Win 7 + Chrome Latest).
I can't reproduce this problem on my side. But I see errors on a customers frontends.
Request from page: goo[.]gl/T2d2oh
To API: "/user/getAds"
Fail callback called in a request:
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();
});
The same 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);
})
Exception... "" nsresult: "0x805e0006 ()" location: "JS frame :: http://site.ru/scripts/vendor/angular.js :: createHttpBackend/< :: line 8494" data: no
Upvotes: 0
Views: 516
Reputation: 692
SOLUTION
Rename API request patch from "/user/getAds" to "/user/getObjects" to avoid block from ads blocker apps.
Upvotes: 4