使用Google+分享按钮获取数据

时间:2014-03-05 15:00:08

标签: url button get google-plus share

我想在HTML电子邮件中使用Google+分享按钮。我把超链接

https://plus.google.com/share?url={URL} 

进入电子邮箱。

但是当我尝试超链接时,GET数据存在问题。如果我将?parameter=name放入网址,则说明不会接受该网址。

如何发送正确的网址?

1 个答案:

答案 0 :(得分:0)

根据documentationurl值必须经过网址编码。

E.g。 http://example.com/?foo=bar应为http%3A%2F%2Fexample.com%2F%3Ffoo%3Dbar

https://plus.google.com/share?url=http%3A%2F%2Fexample.com%2F%3Ffoo%3Dbar

在JavaScript中,您可以使用encodeURIComponent('http://example.com/?foo=bar')