使用Jquery解析货币YQL
因为我可以使用 Jquery 解析此查询 YQL。 我看不到信息 非常感谢
Json
{
"query": {
"count": 2,
"created": "2012-01-25T18:58:01Z",
"lang": "en-US",
"results": {
"span": [
{
"id": "yfs_l10_audmxn=x",
"content": "13.8172"
},
{
"id": "yfs_l10_audmxn=x",
"content": "13.8172"
}
]
}
}
}
Jquery
<script>
$(function(){
$.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fmx.finance.yahoo.com%2Fq%3Fs%3DAUDMXN%3DX%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2F*%5B%40id%3D%22yfs_l10_audmxn%3Dx%22%5D'&format=json&callback=", function(data){
$('#currency').html(data.query['results'].span);
});
});
</script>
tnks =)
As I can parse this query YQL using Jquery.
I can not see the information
thank you very much
Json
{
"query": {
"count": 2,
"created": "2012-01-25T18:58:01Z",
"lang": "en-US",
"results": {
"span": [
{
"id": "yfs_l10_audmxn=x",
"content": "13.8172"
},
{
"id": "yfs_l10_audmxn=x",
"content": "13.8172"
}
]
}
}
}
Jquery
<script>
$(function(){
$.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fmx.finance.yahoo.com%2Fq%3Fs%3DAUDMXN%3DX%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2F*%5B%40id%3D%22yfs_l10_audmxn%3Dx%22%5D'&format=json&callback=", function(data){
$('#currency').html(data.query['results'].span);
});
});
</script>
tnks =)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
货币信息就在那里。我不知道为什么你看不到它。
也许您应该使用这个,
data.query['results'].span[0].content
包含13.8172
。这意味着
MXN 1 = AUD 13.8172
The currency information is there. I dont know why you dont see it.
May be you should use this,
data.query['results'].span[0].content
contains13.8172
.Thats means
MXN 1 = AUD 13.8172
演示
DEMO