Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter share button: share hash part of URL?

I have a site that dynamically updates the URL hash as the user navigates through it (it's a Backbone.js app and I'm using pushState).

I'd like the user to be able to tweet the full URL, including the hash.

I'm using the Twitter share button, but it seems to only share the basic URL path, not the hash, which is quite important:

<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>

Any ideas for how I can let users share the hash as well?

Thanks for your help.

like image 591
Richard Avatar asked Dec 16 '22 01:12

Richard


1 Answers

the trick is to replace the hash sign with its html encoded character which is : %23

like image 82
B.R Avatar answered Jan 02 '23 20:01

B.R