0

Iam getting CORS issue with GET call.

XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin

I even tried jsonp approach,here I can seeing 200 response coming from that call in network tab.But Iam not able capture that data and display on UI and Iam getting following error on console

 Uncaught SyntaxError: Unexpected token :

Below is my code

var url ="https://10.11.13.155:9445/ibm/iis/igc-rest/v1/assets/6662c0f2.ee6a64fe.1mdlmv34b.anfhlbg.dmjrjk.5ct1qigk0ndbkd22sqp8i"+"?callback=JSON_CALLBACK";
$http({
   method: 'JSONP',
    url: url ,
     headers: {
          'Authorization': 'Basic xxxxx'}
})
.success(function (data) {
  console.log(data);`
  $scope.gridOptions.data = data.terms.items;
 });

Can someone help me what should I do here to capture the respnse coming from rest call.

user7350714
  • 365
  • 1
  • 6
  • 20

0 Answers0