【发布时间】:2014-10-09 20:05:07
【问题描述】:
我的 Angular 请求有问题。
angular.module('google-chart-example', []).controller("MainCtrl", function ($scope,$http,$log) {
$scope.infos = "";
//$http.get('http://ip.jsontest.com')
//$http.get('https://finance.google.com/finance/info?q=TSE:PXT')
$http.get('http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.quotes where symbol in ("AAPL")&format=json')
.success(function(data) {
//alert ("toto");
$scope.infos = data;
})
.error(function(data) {
alert ("data="+data);
$scope.infos = data;
});
});
$http.get('http://ip.jsontest.com') ==>这是一个工作正常..没问题
$http.get('https://finance.google.com/finance/info?q=TSE:PXT') ==> 这个不行,我没有结果
$http.get('http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.quotes where symbol in ("AAPL")&format=json') ==> 这个,我得到了答案,但它告诉我该表不存在: {"error":{"lang":"en-US","description":"找不到表 yahoo.finance.quote 的定义"}} (我试过引用和引用:相同的结果)
知道为什么我无法检索我的价格吗?
我的 HTML:
<html xmlns="http://www.w3.org/1999/html">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.18/angular.js"</script>
<script src="index3.js"></script>
</head>
<body ng-app="google-chart-example" ng-controller="MainCtrl">
coucou <br>
{{infos}}
</body>
</html>
【问题讨论】: