如果点击按钮,Facebook可以如何重定向? [英] How can I redirect once facebook like button is clicked?

查看:77
本文介绍了如果点击按钮,Facebook可以如何重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,这里有一个想法:
我正在开始一个每日博客,为了获得登月的帖子,用户需要共享该网站。
我已经弄清楚如果有人按下+1按钮,如何重定向,以及如果有人推and了如何重定向,但是我还没有弄清楚如何在Facebook之后重定向。
如果有人可以帮助这个,我会非常感谢。

Basically, here is an idea: I am starting a daily blog, and in order to gain access to sunday's posts, the user needs to share the site. I have figured out how to redirect once someone presses the +1 button, and how to redirect once someone tweets, but I have yet to figure out how to redirect after a facebook like. If anyone can help with this, I'll be very thankful.

为了记录,我打算尽可能地这样做。基本上来说,这个帖子会说我正在努力获得该网站的受欢迎程度,我真的可以使用一些股票,我会指出,他们每周都会收到六个帖子,而不需要任何东西,我会告诉他们如果他们真的不想分享,我们很好,他们删除了该帖子。

For the record, I plan on doing this as whitehat-edly as possible. Basically, the post will say that I'm trying to gain popularity for the site, that I could really use some shares, I'll point out that they get six posts a week without asking for anything, and I'll tell them that I'm fine with them deleting the post if they really don't want to share it.

另外一件事,我不在乎他们是否发布Facebook或不。喜欢,代码不需要检查他们的Facebook页面,以确保它的工作。我只是想要它,以便当他们点击按钮,它发布,并重定向它们。该页面不会被隐藏,如果有人拥有直接的网址,他们可以得到它没有分享。我只是希望它很简单,因为我是一个业余爱好者,但我也想用这个来获得更多的流量和更多的受众。

One other thing, I don't really care if they post it on facebook or not. Like, the code doesn't need to check their facebook page to make sure it worked. I just want it so that when they click the button, it posts, and redirects them. The page won't be hidden, if someone had the direct URL they could get to it without sharing. I just want it to be simple, as I'm an amateur, but I also want to use this to get more traffic and a more engaged audience.

提前感谢,
Liam

Thanks in advance, Liam

推荐答案

虽然你在做什么不是一个好主意,但点击Like 按钮可以通过Facebook javascript事件处理, edge.create

While what you are doing is not a good idea at all, redirecting after clicking the "Like" button can be handled with the Facebook javascript event, edge.create:

FB.Event.subscribe('edge.create',
    function(response) {
        location.href = 'http://yourdomain.com/post/id';
    }
);

这篇关于如果点击按钮,Facebook可以如何重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆