Facebook 连接邀请好友后重定向

发布于 2024-10-04 18:08:58 字数 1887 浏览 2 评论 0原文

我可以问一下用户邀请朋友后如何重定向页面吗?

我有这样的代码:(在javascript中)

    function inviteFriends(){
  if(isBusy) return false;
  isBusy = true;
  $(".musicPlayer").addClass("invisible");

  var fbsc = '<fb:request-form
action="apps.facebook.com/yourapp?pageid=thanks"
target="_self"
method="post"
nvite="true"
type="Contest"
content="Come and Join this contest!"> <fb:multi-friend-selector
target="_self"
showborder="false"
max="30"
import_external_friends="false"
email_invite="false"
cols="5"
actiontext="Invite your friends!" /></fb:request-form>';

  var uiSize = FB.UIServer.Methods["fbml.dialog"].size;
  FB.UIServer.Methods["fbml.dialog"].size = {width:625};
  FB.ui({
   method:'fbml.dialog',
   display: 'dialog',
   fbml: (fbsc),
   width: '625px'
  },function(response) {
   $(".musicPlayer").removeClass("invisible");
   window.location = "?pageid=thanks";
   isBusy = false;
  });
 }

该脚本将调用fbml窗口,并在facebook对话框窗口内使用facebook的邀请朋友对话框。

我想要的是:

  1. 当您关闭窗口(按右上角的 x)时,它会重定向到: ?pageid=thanks (这适用于上面的脚本)
  2. 当用户按下邀请朋友对话框上的跳过按钮时,它会重定向到: ?pageid=thanks (这不起作用 - 它会重定向到 ?pageid=thanks 但在 fbml 窗口内)
  3. 当用户邀请完朋友后,它也会重定向到: ?pageid=thanks (这是也不起作用 - 它会重定向到 ?pageid=thanks 但在新窗口中 -.-!)

我是否错过了上面脚本中的某些内容,或者我使用了错误的方式? 我想至少在 IE 和 Firefox 中实现这一点,

以前有人这样做过吗?我真的需要你的建议,

编辑

如果我输入:

<fb:request-form target="_top" blah...> <fb:multi-friend-selector target="_self" blah...>

跳过按钮正在工作:)但是,在你邀请完你的朋友后,它会重定向到一个新窗口

如果我输入:

<fb:request-form target="_top" blah...> <fb:multi-friend-selector target="_parent" blah...>

这个如果你邀请你的朋友是可以的,但如果你按下跳过按钮就不行了-.-! 我认为这是因为当您单击“邀请您的朋友”时,Facebook 打开了另一个对话框窗口(在单击“发送”之前进行预览),

因此“跳过”按钮和“发送”按钮之间的结构级别不同(我希望您明白我写的内容)

提前谢谢

can I have a question about how to redirect the page after user invite their friends?

i have a code like this: (in javascript)

    function inviteFriends(){
  if(isBusy) return false;
  isBusy = true;
  $(".musicPlayer").addClass("invisible");

  var fbsc = '<fb:request-form
action="apps.facebook.com/yourapp?pageid=thanks"
target="_self"
method="post"
nvite="true"
type="Contest"
content="Come and Join this contest!"> <fb:multi-friend-selector
target="_self"
showborder="false"
max="30"
import_external_friends="false"
email_invite="false"
cols="5"
actiontext="Invite your friends!" /></fb:request-form>';

  var uiSize = FB.UIServer.Methods["fbml.dialog"].size;
  FB.UIServer.Methods["fbml.dialog"].size = {width:625};
  FB.ui({
   method:'fbml.dialog',
   display: 'dialog',
   fbml: (fbsc),
   width: '625px'
  },function(response) {
   $(".musicPlayer").removeClass("invisible");
   window.location = "?pageid=thanks";
   isBusy = false;
  });
 }

that script will call fbml window with facebook's invite friends dialog inside facebook dialog window.

what i want is:

  1. when you close the window (press x at top right corner) it'll redirect to: ?pageid=thanks (this is works with the script above)
  2. when user press the skip button on invite friends dialog it'll redirect to: ?pageid=thanks (this is not working - It'll redirect to ?pageid=thanks but inside the fbml window)
  3. when user have done inviting their friends, it'll also redirect to: ?pageid=thanks (this is also not working - it'll redirect to ?pageid=thanks but in new window -.-!)

am I miss something on my script above, or I'm using the wrong way?
I'd like to achieve this for at least in IE and Firefox

is anyone have done with this before? I really need your suggestion,

EDIT:

if i put:

<fb:request-form target="_top" blah...> <fb:multi-friend-selector target="_self" blah...>

The skip button is working :) but still, after you're done inviting your friends it'll redirect to a new window

If I Put:

<fb:request-form target="_top" blah...> <fb:multi-friend-selector target="_parent" blah...>

This is work if you invite your friends, but not if you press the skip button -.-!
I reckon this is because of facebook open-up another dialog window when you click invite your friends (to preview before you click send)

so the structure level was different between skip button and send button (i hope you got what I'm write)

Thank you in advance

AnD

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

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

发布评论

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

评论(2

月光色 2024-10-11 18:08:58

这就是答案:)

var fbsc = '<fb:request-form action="url here" target="_top" method="post" invite="true" type="Contest" content="blah...">
<fb:multi-friend-selector target="_top" showborder="false" max="30" import_external_friends="false" email_invite="false" cols="5" actiontext="Join NOW to WIN!" /></fb:request-form>';

注意:target="_top"

This is The answer :)

var fbsc = '<fb:request-form action="url here" target="_top" method="post" invite="true" type="Contest" content="blah...">
<fb:multi-friend-selector target="_top" showborder="false" max="30" import_external_friends="false" email_invite="false" cols="5" actiontext="Join NOW to WIN!" /></fb:request-form>';

Note: target="_top"

北方的巷 2024-10-11 18:08:58

尝试将 target="_self" 更改为 target="_parent" 我不确定这是否正是您所需要的,但 target 是相关参数在这里。

Try changing target="_self" to target="_parent" i'm not sure that is exactly what you need but the target is the relevant parameter here.

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