Rather than html encoding
your URL parameter, you need to URL encode
it:(您需要对URL encode
,而不是html encoding
您的URL参数进行html encoding
:)
http://www.facebook.com/sharer.php?&t=FOOBAR&u=http%3A%2F%2Fwww.foobar.com%2F%3Ffirst%3D12%26sec%3D25%26position%3D
You can do this easily in most languages - in javascript :(您可以在大多数语言中轻松完成此操作 - 在javascript中 :)
var encodedParam = encodeURIComponent('www.foobar.com/?first=1&second=12&third=5');
// encodedParam = 'http%3A%2F%2Fwww.foobar.com%2F%3Ffirst%3D12%26sec%3D25%26position%3D'
(there are equivalent methods in other languages too)((也有其他语言的等效方法))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…