Facebook channel
I'm trying to post something to a Facebook user's feed and then redirect the user to another page, but it looks like the page just reloads without any prompts to send the user feed.
FB.Connect.showFeedDialog(1111111, null, null, null, null, null, redirectTo(), null, null);
function redirectTo()
{
window.top.location = "/mywebsite";
}
if I just call the show channel and it works right.
FB.Connect.showFeedDialog(1111111, null, null, null, null, null, redirectTo(), null, null);
Anyone who knows why the first lines of code keep reloading the page in an infinite loop?
0
a source to share
1 answer
When registering a callback function, you want to pass a reference to the function and not actually call the function. Remove the parentheses from redirectTo on your first line:
FB.Connect.showFeedDialog(1111111, null, null, null, null, null, redirectTo, null, null);
function redirectTo(){
window.top.location = "/mywebsite";
}
+2
a source to share