Reputation: 53
I'm trying to add a tweet button to html page , I use the official code from the twitter button generator , http://twitter.com/about/resources/buttons#tweet
when I test the page on chrome and Firefox , the button doesn't appear , only an underlined text says : "Tweet"
here is the code :
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.3eesho.com/magazine/index.html" data-text="issue2 now" data-via="3eesho" data-hashtags="ipad,health,arabicmagazine">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</body>
</html>
Upvotes: 4
Views: 9461
Reputation: 11
For me it was the chrome extension AdBlock that was causing the issue.
Thanks to others for pointing me in the right direction!
Upvotes: 1
Reputation: 3638
See your code in action here It works fine in Firefox, Chrome and IE as I just tested.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.3eesho.com/magazine/index.html" data-text="issue2 now" data-via="3eesho" data-hashtags="ipad,health,arabicmagazine">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</body>
</html>
Check out the screenshot below, your code's performance in IE 8, Firefox 9, Chrome 16. it works as expected.
Upvotes: 0
Reputation: 5124
I just noticed that I duplicated @jcaruso's reply.
tl;dr;
Try disabling ad-blocking extensions. For me the problems were caused by disconnect.me
extension.
How I found that out? I noticed in the chrome dev console, that request to twitter to load widgets.js
gets a 307 redirect to about:blank
.
Thanks to that answer I figured out that it's caused by one of the extensions. Disabling the disconnect.me
extension fix the problem with twitter and facebook buttons on mine and other pages.
Upvotes: 3
Reputation: 1020
I had this same problem, and it drove me nuts until I narrowed it down to cookies possibly being blocked. I was running an Add-On called 'Disconnect' from https://disconnect.me/ . Once I disabled this addon and restarted the browser the Tweet button started working again.
So if you're using that addon or any other one to block cookies or prevent you from being tracked by social networking sites, you'll need to disable it if you want to see the tweet button.
Upvotes: 7
Reputation: 4137
Your code is fine. If you can't see the button, this means you don't have access to twitter.com.
Make sure you can access twitter.com normally via your browser and that your company, firewall, parental control, etc is not blocking access or interfering with it in any way.
Upvotes: 0