twitterフォロワーを数えるために使用される次のスクリプトを考えてみましょう。何らかの理由で私はリストを2度入手します。配列の要素に対して、のフォロワー数統計が必要です。どんな助けでも大歓迎です。Jquery、JSON twitter followers count
echo "<div id='twitter'>
<script type='text/javascript'>
$(document).ready(function(){
var i;
twitterusername = ['Sinbg','followfog','miniclip','vgames'];
for(i=0; i<4; i++){
(function(i){
$.getJSON('http://twitter.com/users/' + twitterusername[i] + '.json?callback=?',
function(data){
$('#twitter').html(document.getElementById('twitter').innerHTML + twitterusername[i] + ' ' +
data.followers_count + ' Followers' + '<br/>');
}
) // end getJSON
})(i);
}// end for??
});</script></div>";
スクリプトタグの親要素のHTMLを置き換えます。それがあなたの問題なのかどうかは分かりませんが、それは正しいようには見えません。 – gilly3