开发者

Sharer link with parameter in URL

开发者 https://www.devze.com 2023-04-08 19:59 出处:网络
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>

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.


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');
0

精彩评论

暂无评论...
验证码 换一张
取 消