开发者

How To, Tweet Button sample code help?

i'm trying to implement a Tweet Button from this 开发者_如何学Pythonpage http://dev.twitter.com/pages/tweet_button

and it looks like ti doesn't working very well for me. if my website is www.xxx.com the script should be:

<a href="http://twitter.com/share?url=http%3A%2F%2Fdev.twitter.com%2Fxxx" class="twitter-share-button">Tweet</a>

the graphics load but the count is 0.

i don't understand what could be wrong. any ideas?

Thanks


Try this code, using jQuery

<img id="tweetButton" style="cursor:pointer;" title="Share this on Twitter" src="http://a3.twimg.com/a/1294785484/images/goodies/tweetn.png" />

$("#tweetButton").click(function () {
            window.open("http://twitter.com/share?url=xxx", "tweet", "status=0,toolbar=0,width=500,height=300");
});


You need to go register for this feature on the twitter developers site. Once you do that it should generate some sort of number or code for you to put on your page that will link everything together and start counting as it should.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜