According to this topic: Follower count number in Twitter
根据这个主题:Twitter中的追随者数量
I'm using this code:
我正在使用此代码:
<script>
jQuery.ajax({
url: "https://cdn.syndication.twimg.com/widgets/followbutton/info.json?screen_names=*",
dataType : 'jsonp',
crossDomain : true
}).done(function(data) {
console.log(data[0]['followers_count']);
jQuery('#followers_count').append(followers_count).digits($);
});</script>
And this:
<span id="followers_count"></span>
To retrieve the followers count from Twitter Rest API, but it's not working. I'd like to know if there is any way to retrieve that data, using REST or not, and with jQuery only. No php, only javascript, JSON or jQuery. Is it possible to use any javascript library for that? I can't use php, got my own reasons.
要从Twitter Rest API中检索关注者数量,但它无效。我想知道是否有任何方法可以使用REST或仅使用REST来检索数据。没有PHP,只有javascript,JSON或jQuery。是否可以使用任何JavaScript库?我不能用php,得到了我自己的理由。
1 个解决方案
#1
1
I think your issue is that you are appending an unidentified variable followers_count
is not defined anywhere.
我认为你的问题是你附加了一个未识别的变量followers_count没有在任何地方定义。
var followers_count = data[0]['followers_count'];
jQuery('#followers_count').append(followers_count);
#1
1
I think your issue is that you are appending an unidentified variable followers_count
is not defined anywhere.
我认为你的问题是你附加了一个未识别的变量followers_count没有在任何地方定义。
var followers_count = data[0]['followers_count'];
jQuery('#followers_count').append(followers_count);