未捕获的错误:函数未定义

时间:2014-03-16 18:20:17

标签: javascript jquery facebook

我有一个非常简单的代码,可以从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);
    }
}

0 个答案:

没有答案