Facebook 连接邀请好友后重定向
我可以问一下用户邀请朋友后如何重定向页面吗?
我有这样的代码:(在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的邀请朋友对话框。
我想要的是:
- 当您关闭窗口(按右上角的 x)时,它会重定向到: ?pageid=thanks (这适用于上面的脚本)
- 当用户按下邀请朋友对话框上的跳过按钮时,它会重定向到: ?pageid=thanks (这不起作用 - 它会重定向到 ?pageid=thanks 但在 fbml 窗口内)
- 当用户邀请完朋友后,它也会重定向到: ?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:
- when you close the window (press x at top right corner) it'll redirect to: ?pageid=thanks (this is works with the script above)
- 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)
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是答案:)
注意:
target="_top"
This is The answer :)
Note:
target="_top"
尝试将
target="_self"
更改为target="_parent"
我不确定这是否正是您所需要的,但target
是相关参数在这里。Try changing
target="_self"
totarget="_parent"
i'm not sure that is exactly what you need but thetarget
is the relevant parameter here.