Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS post失败,jQueryAjax也失败。没有CORS_Javascript_Jquery_Ajax_Angularjs - Fatal编程技术网

Javascript AngularJS post失败,jQueryAjax也失败。没有CORS

Javascript AngularJS post失败,jQueryAjax也失败。没有CORS,javascript,jquery,ajax,angularjs,Javascript,Jquery,Ajax,Angularjs,我和两个顾客遇到了一个奇怪的问题。前端无法在页面角度指令中发送POST/GET请求 行: 例外情况: Exception { message: "", result: 2153644038, name: "", filename: "http://site.ru/scripts/vendor/angular.js", lineNumber: 8327, columnNumber: 0, inner: null, data: null } 这是对同一域的常见请求,没有COR 这个问题只在客户方面

我和两个顾客遇到了一个奇怪的问题。前端无法在页面角度指令中发送POST/GET请求

行:

例外情况:

Exception { message: "", result: 2153644038, name: "", filename: "http://site.ru/scripts/vendor/angular.js", lineNumber: 8327, columnNumber: 0, inner: null, data: null }
这是对同一域的常见请求,没有COR

这个问题只在客户方面重现(现在有两个客户面临这个问题,第一个是Win 8.1+Firefox最新版本,第二个是Win 7+Chrome最新版本)

我无法重现这个问题。但我在客户前端看到错误

从页面请求:goo[.]gl/T2d2oh
API:“/user/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();
});
与角柱相同:

$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:“0x805e0006()”位置:“JS frame:::createHttpBackend/<::line 8494”数据:无解决方案


将API请求补丁从“/user/getAds”重命名为“/user/getObjects”,以避免来自ads阻止程序的阻止。

解决方案


将API请求补丁从“/user/getAds”重命名为“/user/getObjects”,以避免来自ads blocker应用程序的阻止。

这不是质量问题。请张贴更多的代码和什么正确的错误详细信息…我张贴更多的代码。但我无法获得任何错误详细信息,只有例外。这不是质量问题。请张贴更多的代码和什么正确的错误详细信息…我张贴更多的代码。但我无法获得任何错误详细信息,只有一个例外。
$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);
})