1

I am requesting three urls in AngularJs by Using JSONP.

For the first time i am getting the values. But after second call i am not getting any value. When i see the console i found this error.

Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them

What is this error meant by?

Here is my sample code.

appPortal.controller('HistoCtrl', ['$rootScope', '$scope', '$http', '$location',
    function($rootScope, $scope, $http, $location) {
        console.log($rootScope);

        $scope.url1 = '';
        $scope.url2 = '';
        $scope.url3 = '';

        //request handler
        $scope.sendDataRequest = function() {
            $http.jsonp($scope.url1).then(function(msg) {
                console.log(msg.data);
            });
            $http.jsonp($scope.url2).then(function(msg) {
                console.log(msg.data);
            });
            $http.jsonp($scope.url3).then(function(msg) {
                console.log(msg.data);
            });
        };

        //get current month data
        $scope.getCurrentMonthData = function() {
            $scope.url1 = $rootScope.ApiWeatherHost + '/climo/v1/actuals/' + $scope.location_key + '?callback=JSON_CALLBACK&start=' + $scope.start + '&end=' + $scope.end + '&apikey=' + $rootScope.ApiKey;
            $scope.url2 = $rootScope.ApiWeatherHost + '/climo/v1/records/' + $scope.location_key + '?callback=JSON_CALLBACK&start=' + $scope.start + '&end=' + $scope.end + '&apikey=' + $rootScope.ApiKey;
            $scope.url3 = $rootScope.ApiWeatherHost + '/climo/v1/normals/' + $scope.location_key + '?callback=JSON_CALLBACK&start=' + $scope.start + '&end=' + $scope.end + '&apikey=' + $rootScope.ApiKey;
            $scope.sendDataRequest();
        };
    }
]);

I am try to get these rest API Using the Jsonp

http://api.accuweather.com/developers/climoAPIguide

mani
  • 1,012
  • 7
  • 26
  • 47
  • Maybe show more code, you said you issue three requests. – dfsq Sep 21 '14 at 12:00
  • @dfsq PLease refer this.. i am having similar issue.. https://github.com/angular/angular.js/issues/1551 – mani Sep 21 '14 at 12:41
  • @dfsq I saw the request out put for my url. The out put is not attaching the Angular.callback_0.1. is this necessary in the output for jsonp request ? – mani Sep 21 '14 at 14:43
  • Try the solution referenced here: http://stackoverflow.com/questions/13267285/angular-resource-with-jsonp-not-working – Chad Robinson Sep 22 '14 at 12:13
  • @ChadRobinson http://codepen.io/dustin/pen/DJIKi – mani Sep 24 '14 at 17:47

0 Answers0