【发布时间】:2011-09-28 13:42:20
【问题描述】:
我有一个带有 Facebook custom share link 的弹出窗口。
http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>
如何使用带有http://google.com/?q=bla 之类参数的网址u?看起来 facebook 总是删减参数。
【问题讨论】:
我有一个带有 Facebook custom share link 的弹出窗口。
http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>
如何使用带有http://google.com/?q=bla 之类参数的网址u?看起来 facebook 总是删减参数。
【问题讨论】:
您应该对参数进行 URL 编码。
var facebook_url = 'http://www.facebook.com/sharer.php?'+
'u='+encodeURIComponent('http://google.com/?q=bla')+
'&t='+encodeURIComponent('Some Page Title');
【讨论】: