开发者

Is there anyway to add multiple Tweet buttons on the same page and have their own Tweet Counts

开发者 https://www.devze.com 2023-03-01 10:41 出处:网络
I was thinking of setting up some tweet buttons for people to tweet out various sections of a long article using #anchor tags

I was thinking of setting up some tweet buttons for people to tweet out various sections of a long article using #anchor tags

eg a URL like this

http://www.w3schools.com/html_links.htm#tips
http://www.w3schools.com/html_links.htm#questions

There would be a Twee开发者_JAVA技巧t button next to each Anchor Tag

Is this possible and will each tweet button have their own unique Count on their respective buttons?

eg

<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.w3schools.com/html_links.htm#tips" data-text="I have Tweeted the Tips Link" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.w3schools.com/html_links.htm#questions" data-text="I have Tweeted the Questions Link" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

Many thanks in advance

Cheers Andy


Twitter disregards #fragments in their tweet button counts so multiple tweet buttons linking to multiple sections of a single page will all have the same count. You can have multiple tweet buttons on a single page with different counts but they will have to be fore separate pages. For example a blog of example.com could have two tweet buttons with different counts but they would have to be for:

example.com/1
example.com/2


A workaround is to play with GET values. You can use this kind of url for the tweeter button :

http://www.w3schools.com/html_links.htm?anchor=tips
http://www.w3schools.com/html_links.htm?anchor=questions

Then, you add some JS to jump to the anchor when the user come from tweeter.

0

精彩评论

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