Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharer link with parameter in URL

I have a popup window with a Facebook custom share link.

http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>

How can I use a url u with a parameter like http://google.com/?q=bla? It looks like facebook always cut of the parameter.

like image 488
PiTheNumber Avatar asked Sep 28 '11 13:09

PiTheNumber


1 Answers

You should URL encode the parameters.

var facebook_url = 'http://www.facebook.com/sharer.php?'+
  'u='+encodeURIComponent('http://google.com/?q=bla')+
  '&amp;t='+encodeURIComponent('Some Page Title');
like image 120
Teddy Avatar answered Oct 24 '22 05:10

Teddy