I have access to some database on other server but still I am not being able to get data for this json it shows cors and shows 2 errors XHR failed loading: GET, XMLHttpRequest cannot load:CORS but I do have access to that server earlier also it showed cors while posting data but there was some code error and not server acceptance problem. This time in getting data is also I guess some code error on my side
{
"emp": [
{
"BNK": "Rock",
"GPIs": [
"9233333456"
]
},
{
"BNK": "Jack",
"GPIs": [
"9234343434",
"9289989898"
]
}
],
"status": "ok"
}
<script>
var countryApp = angular.module('countryApp', []);
countryApp.controller('CountryCtrl', function ($scope, $http){
$http.get('http://oher_server_url').success(function(data) {
console.log(data);
$scope.dta = data.emp;
});
});
</script>
<table border=1>
<tr>
<th>type_BNK</th>
<th>type_GPIs</th>
</tr>
<tr ng-repeat="x in dta ">
<td>{{x.BNK}}</td>
<td>{{x.GPIs}} </td>
</table>
urlyou're trying to access is is a different domain that yours and hence being rejected. You'll need to configure the server to allow your domain.