我如何在社交网站上分享我的网页首页

时间:2014-04-30 09:11:18

标签: gwt

在我的api中,我有一些按钮,我希望当用户点击特定按钮时,我的网页首页将在SNS上共享,如(FB,G +等)。

googlePlusshare.addClickHandler(new ClickHandler() {
            public void onClick(final ClickEvent clickEvent) {
                    Window.open("https://plus.google.com/share?url=www.example.com","_blank","");

            }
       });

使用以下代码仅链接是共享,而我希望我的首页共享像帖子和网页显示像一个图像。谷歌如何在共享期间选择图像 请帮忙

1 个答案:

答案 0 :(得分:0)

google pluse和facebook支持ogp(开放图协议)及其提供的一些元标记在facebook和g +上共享内容信息

<meta property="og:title" content="" />
<meta property="og:type" content="" /> 
<meta property="og:url" content=""; />
<meta property="og:image" content=""/> 

如果我们使用简单的元标记,如

<meta name="Keywords" content="">
<meta name="Description" content="">
<meta name="viewport" content="">

这些帮助搜索谷歌 如果我们尝试分享g +它只分享HTML页面标题。

 NOTE : if you are using both page title and meta title then it ll read only page title, if you provide diffrent URL. whereas on same page url it wlii work... 
相关问题