【问题标题】:GET data with Google+ share button使用 Google+ 分享按钮获取数据
【发布时间】:2014-03-05 15:00:08
【问题描述】:

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

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

进入电子邮件。

但是当我尝试超链接时,GET-data 有问题。如果我在 URL 中输入?parameter=name,Google+ 不会接受它。

如何发送正确的 URL?

【问题讨论】:

  • 请澄清问题(包括错误文本、完整响应等)。

标签: url button get google-plus share


【解决方案1】:

根据documentation,url 值必须是 url 编码的。

例如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')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-10
    • 2017-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多