Twitter share - encoding ampersands


I am using a javascript encoded twitter share link like this:’ + encodeURIComponent(location.protocol + “//” + + “/” + queryString)

However as I can successfully see the fully decoded address with query string on the twitter address bar, the tweet box itself only contains the link till the first ampersand … How can i get the tweet box to show the url with full query string?

Any help will be appreciated!


Can you share an example of the output of the string you’re constructing here? The important part is that the URL has the “&” characters escaped as “%26”


And magically the problem is gone =/ could it have been a case of caching? haven’t found much information about caching from twitter side.

Anyways problem solved!