FB.ApiClient.fql_query

Description

Make an FQL query directly from the client. FQL is the most efficient way to request data in Javascript. Almost all other read methods can be expressed as FQL queries.

Your callback will receive an array of row objects. Each object has keys corresponding to your selected query. For instance, in this query:

 SELECT name,pic FROM user WHERE uid=211031

The response comes back:

 [{name:"Ari Steinberg", pic:"http://profile.ak.fbcdn.net/v222/1805/47/s211031_4533.jpg"}]

Examples

Make the above query and show it in an alert.

 FB.Facebook.apiClient.fql_query("SELECT name, pic FROM user WHERE uid=211031",
                                 function(rows) {
                                   alert("Hello, " + rows[0].name);
                                 });

Signature

fql_query(String query,  Object onRequestCompleted)

Parameters

queryString

an FQL query.

onRequestCompletedObject

a callback function for immediate execution, or an instance of FB.BatchSequencer