Facebook 集成到网站

发布于 2024-12-01 15:25:02 字数 616 浏览 0 评论 0原文

我希望将“喜欢”按钮集成到网站中,但我对网络上提供的信息有点困惑。我读了这篇文章,它位于另一篇 stackoverflow 文章中,但有一些问题: http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/

我已经在 facebook 中设置了一个“页面”,根据我在上面链接中的理解,您需要设置一个“应用程序”来获取 API 密钥。但我不明白的是,如果我使用这个 API 密钥,它将指向我新创建的“应用程序”,它没有粉丝群。如何链接此 API 密钥(或通过页面管理员设置另一个密钥),以便让用户“喜欢”真正的 Facebook 页面?

我想在用户喜欢该页面时运行一些 javascript 函数,但我也对调用哪些 API 函数以及这些函数是否返回 true/false 值感到有点困惑?我只想在用户尚未喜欢该页面时运行这些 js 函数。

希望这一切都有道理,希望您能提供任何解释来为我指明正确的方向。

I'm looking to integrate the "like" button into a website, but I'm a little confused with the information available on the web. I read this article, which was in another stackoverflow article, but have some questions: http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/.

I've setup a "Page" already in facebook, and from what I understand in the link above, you need to setup an "App" to get an API key. What I don't understand though is that if I use this API Key, it's going to be pointing to my newly created "App", which has no fan base. How do I link this API Key, (or setup another key through the page admin), so I can have users "like" the real facebook page?

I want to run some javascript functions the moment a user likes the page, but I'm also a little confused on what API functions call, and whether these return a true/false value? I only really want to run these js functions if the user has not already liked the page..

Hope this all makes sense, would love any explanations you have to offer to point me in the right direction.

BUMP

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深者入戏 2024-12-08 15:25:02

创建页面并在脸书上注册后,您将获得一个链接,然后再次完成该过程。然后只需将此链接粘贴到您的网站上,您就会看到类似框。将其粘贴到 div 标签中。

您还可以在 js 中创建一个像 box 一样调用此函数的函数,并且根据其依赖项,您也可以调用其他 js 函数。

//js代码

function js()

{

创建元素 div;

}

函数 other()

{

js();

}

after making a page and registering for it on face book, you will get a link, o trough the process again. Then just paste this link on your web site and you will get the like box. Paste it in a div tag.

You can also make a function in js which calls this like box and on its dependency you can call other js functions also.

//js code

function js()

{

create element div;

}

function other()

{

js();

}

云归处 2024-12-08 15:25:02

如果您只想在页面中添加“赞”按钮,请访问 http://developers.facebook .com/docs/reference/plugins/like/

将您的 Facebook 页面 URL 粘贴到“URL to Like (?)”文本框中,

将代码

粘贴到您想要的网站源代码的 div 框中出现

If you just want an like button in your page , go to http://developers.facebook.com/docs/reference/plugins/like/

paste your fb page url in "URL to Like (?)" text box

get the code

paste in the div box of ur web site source code where you want it to appear

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文