【发布时间】:2015-07-25 16:13:37
【问题描述】:
我正在编写 JavaScript 和 AngularJS 代码,并试图通过 https 网站获取一些 JSON 数据。
我的代码:
var app = angular.module('myApp', []);
app.controller('DecisionsCtrl', function($scope, $http) {
$http.get('https://test3.diavgeia.gov.gr/luminapi/opendata/search.json?org=10599')
.success(function (response) {$scope.decisions = response.decisions;});
});
和
<tr ng-repeat="x in decisions | limitTo:10 ">
<td>{{x.protocolNumber }}</td>
<td>{{x.subject}}</td>
<td>{{x.extraFieldValues.financialYear}}</td>
<td>{{x.extraFieldValues.budgettype}}</td>
</tr>
</table>
如果我使用 http 网站,或者如果我将 https 的东西下载到 file.json 中,没有任何问题。
谁能帮帮我?
【问题讨论】:
-
你看到底部的两个警告了吗?尤其是第二个“Cross-Origin Request Blocked”
-
google the terms used in last error .....会找到成千上万的结果
标签: javascript json angularjs https