我有一个非常简单的代码,可以从Facebook检索共享计数,但我收到的错误是现在定义了sndFBcount函数。
以下是代码:
$.getScript( 'https://api.facebook.com/method/fql.query?query=' + encodeURIComponent( "SELECT total_count, url FROM link_stat WHERE url='" + sndSharingURL + "'" ) + '&format=json&callback=sndFBcount' );
function sndFBcount(data) {
if ( 'undefined' != typeof data.count && ( data.count * 1 ) > 0 ) {
alert(data.count);
}
}