问题描述
||
我使用此功能从Facebook相册中获取照片。请提供建议,为什么它返回空白。
function getPhotos(aid) {
sql = \'SELECT pid,src_big,src_small FROM photo WHERE aid=\'+aid+\' ORDER BY modified desc\';
FB.api(
{
method: \'fql.query\',query: sql
},function(response) {
console.log(response);
}
);
}
解决方法
虽然发布错误会有所帮助,但您应该将ѭ1括在引号中,因为它是一个字符串字段(参考):
sql = \'SELECT pid,src_big,src_small FROM photo WHERE aid=\"\'+aid+\'\" ORDER BY modified desc\';
另外,请确保您具有user_photos
的权限。