简体   繁体   English

单击按钮即可在Facebook上发布和共享

[英]Post and share on facebook on button click

In my site i can give comment to any category or movie i just want when user rate any movie with comment that comment also post on FACEBOOK and share category data on FACEBOOK. 在我的网站上,当用户对带有评论的电影进行评论时,我可以给我想要的任何类别或电影添加评论,该评论也要发布在FACEBOOK上并在FACEBOOK上共享类别数据。

if anybody have knowledge how to implement this please tell me. 如果有人知道如何执行此操作,请告诉我。

我建议使用Share This,它的实现起来非常简单,而且就像一个魅力

I've made a custom function. 我做了一个自定义函数。

Example: 例:

function sharreBrag(){ 函数sharreBrag(){

var obj = {
    method: 'feed',

    link: app.home,
    picture: app.home + '/img/logo.png',
    name: 'TITLE!',
    caption: 'whatever you want',
    description: 'description'
};

function callback(response) {}

FB.ui(obj, callback);

}; };

The app.home is a variable with the link to your site. app.home是带有指向您网站链接的变量。

Also you need to include the Facebook root into your footer. 另外,您还需要在页脚中包含Facebook根目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM