Tweet button does not appear

I am trying to add a twitter button to the html page, I am using the official code from the Twitter button generator, http://twitter.com/about/resources/buttons#tweet

when I check the page on chrome and Firefox, the button does not appear, only the 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> 
+4
source share
4 answers

I had the same problem and it drove me crazy until I narrowed it down to cookies that might have been blocked. I ran the "Disconnect" add-in from https://disconnect.me/ . After I disabled this add-on and restarted the browser, the Tweet button worked again.

Therefore, if you use this add-on or any other to block cookies or prevent social networking sites from tracking you, you need to disable it if you want to see the tweet button.

+5
source

See your code in action here. It works great 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> 

Take a look at the screenshot below: the performance of your code in IE 8, Firefox 9, Chrome 16. works as expected.

Screenshot for the code above

0
source

Your code is ok. If you do not see the button, it means that you do not have access to twitter.com.

Make sure you can directly access twitter.com through your browser and that your company, firewall, parental controls, etc. Do not block access or in any way interfere with it.

0
source

I just noticed that I was duplicating @jcaruso's answer.


TL; DR;

Try disabling ad block extensions. For me, the problems were caused by the disconnect.me extension.


How did I find out? I noticed in the chrome dev console that the twitter request to download widgets.js gets a 307 redirect to about:blank .

about: blank for twitter js

Thanks to which answers , I realized that this is caused by one of the extensions. Disabling the disconnect.me extension fixes the problem using the Twitter and facebook buttons on my and other pages.

0
source

Source: https://habr.com/ru/post/1393706/


All Articles