【问题标题】:How to share content from our site to google plus如何将我们网站上的内容分享到 google plus
【发布时间】:2012-06-05 15:43:45
【问题描述】:

如何将我们网站上的内容分享到 google plus

我试过这样

<a href="javascript:void(0);" onclick="window.open('https://plus.google.com/share?url=<?php echo urlencode('http://example.com');?>&via=example', 'Share on Google Plus', 'width=600,height=400,left=450').focus();" >

在这里我无法分享我网站上的内容。这怎么可能? 我想将内容(例如:你好)分享到具有分享功能的 goggle plus

【问题讨论】:

    标签: html


    【解决方案1】:

    是的。您可以从您的应用中粘贴您必须设置为默认数据的内容。https://developers.google.com/+/web/share/interactive#button_attr_calltoactionurl

    这里没什么可做的..

    只需在开发者部分创建一个 google plus 应用程序。 然后粘贴以下部分

    <button
      class="g-interactivepost"
     data-contenturl="https://plus.google.com/pages/"
      data-contentdeeplinkid="/pages"
      data-clientid="xxxxx.apps.googleusercontent.com"
      data-cookiepolicy="single_host_origin"
      data-prefilltext="Engage your users today, create a Google+ page for your business."
      data-calltoactionlabel="CREATE"
      data-calltoactionurl="http://plus.google.com/pages/create"
      data-calltoactiondeeplinkid="/pages/create">
      Tell your friends
    </button>
    

    然后更改数据客户端 ID。现在它将按照您的期望工作。享受:)

    【讨论】:

      【解决方案2】:

      Google 推出分享按钮已经有一段时间了。你可以在他们的开发者页面上找到这个。 [Here]

      将生成的代码粘贴到您的网页上,然后API会自动接收该页面的链接。

      【讨论】:

      • 我可以通过链接传递内容吗?
      • 不,这种灵活性是给用户的。当他(s)单击共享按钮时,(s)他将键入他们在共享页面时想要的内容。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多