Tweet button: '%20' does not load URL


#1

I’m trying to create a tweet button, the shares a URL dynamically created, here is a snippet of the output code

$(‘a#btnTweetPN’).attr(‘href’, ‘https://twitter.com/intent/tweet’ + ‘?text=Check%20this%20out%20&url=http%3A%2F%2F’ + basePath + ‘%2F’ + controllerName + ‘%2FMethodOne%3Fid%3D’ + id + ‘%26mode%3D’ + ‘This%20time’ + ‘%26somecode%3D’ + codeid);

In HTML the output link should be something like this

tweet this

All good it seems but when you click this and it goes to the next page and tweet the URL is not reproduced or is just not there.

The other buttons that I did worked well but not this one with a space in one of the Parameters. Can anyone share some light why this is happening.


Tweet button will not load URLs with %20 or +
#2

try replacing the %20 with +


#3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.