Reputation: 1969
I am trying t add a twitter share button on my website. I have tried like this:
<a href="https://twitter.com/share"
class="twitter-share-button" data-lang="es" data-size="large"
data-count="none"
data-url="http://localhost/pruebasmarty/Controlador/ServicioDetalle.php">
Twittear</a>
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
But the URL is not showing when the twitter widow is open, its just empty. Ive tried with
<a href="https://twitter.com/share"
class="twitter-share-button" data-lang="es" data-size="large"
data-count="none" >Twittear</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
But its the same. Can anybody help me?
It doesn't show the link i want to share
Upvotes: 0
Views: 1528
Reputation: 190
Can you please try using an external URLS other than local host?
It seems like the localhost or any internal hostnames without proper tld is not recognized as a valid URL to be shared.
I checked the same tag with http://www.google.com and it works.
Upvotes: 1