我的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') ==> this is one工作正常..不客气
$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')这个错误,我得到了一个答案,但它告诉我表不存在:{“==>”:{“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>
发布于 2014-08-16 14:24:19
您尝试查询yahoo.finance.quotes,但查询必须在yahoo.finance.quote上
select * from yahoo.finance.quote
发布于 2014-08-16 15:07:00
使用yql控制台构建查询,它将为您提供一个REST查询url,您可以使用该url发出http GET请求,例如:
发布于 2014-08-17 01:01:43
对于雅虎,我缺少社区表参数:&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
现在可以用了,谢谢。
https://stackoverflow.com/questions/25337392
复制相似问题