0

I have the following code:

var url = 'http://someURL?arg1=test&arg2=test&callback=JSON_CALLBACK';

$http.jsonp(url)
.success(function(data){
    console.log(data.found);
});

I get a status code of 200 ok and I can see the response data on the network tab of chrome with no issues.

This is the response:

[{"card_token":"D233B338C5154BA989FBBF88ECBFFE4C","cc_last_four":"1732","cc_type":"MasterCard","id":451,"site_id":602,"updated_at":"2016-01-23T11:24:58-05:00"}]

I don't understand what the problem is.

1
  • The response is not JSONP. Commented Nov 12, 2019 at 13:49

1 Answer 1

-1

The problem might be with your server side code. Once look at this example.

     $http.jsonp("http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero").
  success(function(data) {
    $scope.data = data;
    $scope.name = data.name;
    $scope.salutation = data.salutation;
    $scope.greeting = data.greeting;
))
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.