AnD
AnD

Reputation: 3129

facebook connect redirect after invite friends

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

Upvotes: 1

Views: 2963

Answers (2)

AnD
AnD

Reputation: 3129

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"

Upvotes: 2

Daniel
Daniel

Reputation: 2381

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.

Upvotes: 0

Related Questions