It may sound a bit funny but i don’t know how to fetch the data taken from a facebook FQL query using javascript. I was looking all over the net and there is only tutorials on how to run the query but now how to fetch the data.
so here is the code i have:
if (response.session) {
FB.api({
method: "fql.query",
query: "SELECT name,email FROM user WHERE uid = " + response.session.uid
});
customar_formcode="'.$formcode.'";
customar_formcode=customar_formcode.replace("{email}", USER EMAIL FROM THE FQL);
customar_formcode=customar_formcode.replace("{name}", USER NAME FROM THE FQL);
document.getElementById('form').submit();
So how to place user’s name and email where “USER EMAIL FROM THE FQL” and “USER NAME FROM THE FQL”.
Thanks.
You have to define callback function: