Graph API Javascript示例中的新FQL Multiquery? [英] New FQL Multiquery in Graph API Javascript Example?

查看:82
本文介绍了Graph API Javascript示例中的新FQL Multiquery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以通过javascript API或ajax进行多重查询吗?

Anyone had luck with doing multiquery through javascript API or ajax?

推荐答案

我已成功完成此操作,但我有一个一开始有点麻烦,文档只有一个php示例。

I have successfully done this, although I had a bit of trouble at first with the documentation only having a php example.

请确保附加查询 json作为api调用中的第二个参数,而不是像php示例中的查询字符串。那就是:

Just make sure you are attaching the queries json as the 2nd parameter in the api call rather than as a query string like in the php sample. That is:

FB.api('/fql', {q:{"query1":"SELECT uid, rsvp_status FROM event_member WHERE eid=12345678","query2":"SELECT name, url, pic FROM profile WHERE id IN (SELECT uid FROM #query1)"}}, 
function(response) {
    // handle response
});

这篇关于Graph API Javascript示例中的新FQL Multiquery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆