如何从facebook应用重定向到我的网站?

如何从facebook应用重定向到我的网站?,facebook,facebook-apps,facebook-invite,Facebook,Facebook Apps,Facebook Invite,我已经从中实现了facebook的邀请框,但我无法了解它们如何重定向到我的网站,因为它们(9lesson)已在facebook通知的演示中显示。 请帮我怎么做 我的代码是: <div id="fb-root"> </div> <a href="javascript:void(0);" onclick="FbRequest('If you want to fulfill your wishes then do not miss the opertuanty, huu

我已经从中实现了facebook的邀请框,但我无法了解它们如何重定向到我的网站,因为它们(9lesson)已在facebook通知的演示中显示。 请帮我怎么做

我的代码是:

 <div id="fb-root">
</div>
<a href="javascript:void(0);" onclick="FbRequest('If you want to fulfill your wishes then do not miss the opertuanty, huury up and join WishIsDone, A platform where you can fulfill your as well as your friends wishes...!','609416079110673');">
    Send Request</a>
<script type="text/javascript">
    function FbRequest(message, data) {
        FB.ui({ method: 'apprequests', message: message, data: data, title: 'Share this site with your friends' },
            function (response) {
                // response.request_ids holds an array of user ids that received the request
                var receiverIDs;
                if (response.request) {
                    var receiverIDs = response.to;  // receiverIDs is an array holding all user ids
                    alert(receiverIDs);
                }
            }
    );
    }
    // typical application initialization code for your site
    (function () {
        var e = document.createElement('script');
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
    } ());
    window.fbAsyncInit = function () {
        FB.init({
            appId: '******',
            session: {},
            status: true,
            cookie: true,
            xfbml: true

        });
    };

</script>

功能请求(消息、数据){
ui({method:'apprequests',message:message,data:data,title:'Share this site with your friends'},
功能(响应){
//response.request_id保存接收请求的用户id数组
var受体;
if(response.request){
var receiverIDs=response.to;//receiverIDs是一个包含所有用户ID的数组
警报(接收方);
}
}
);
}
//站点的典型应用程序初始化代码
(功能(){
var e=document.createElement('script');
e、 src=document.location.protocol+'//connect.facebook.net/en_US/all.js';
e、 异步=真;
document.getElementById('fb-root').appendChild(e);
} ());
window.fbAsyninit=函数(){
FB.init({
appId:“*******”,
会议:{},
状态:正确,
曲奇:是的,
xfbml:对
});
};
我的登录页面代码:

 <script type='text/javascript'>
    if (top.location != self.location) {
        top.location = self.location
    }
</script>

if(top.location!=self.location){
top.location=self.location
}

基本上,当用户单击其中一个邀请时,它们将被发送到应用程序的画布URL。您在应用程序设置中设置的

用户将被发送到您的应用程序,从那里您可以使用JavaScript重定向将他们重定向到实际站点,就像他们在您链接到的教程中所做的那样:

以下代码用于断开Iframe,请将此代码包含到您的网页中


if(顶部位置!=自身位置)
{
top.location=self.location
}

当他们说“破坏Iframe”时,他们的意思是将内容从Iframe中取出,放到它的实际URL中(愚蠢的措辞……我同意)。注意
top.location
的用法。这将更改最顶部框架的位置-在本例中,它是
apps.facebook.com

我已在登录页面中添加了上述代码,但无法获得所需的结果…您的控制台中是否存在JS错误?用户是否真的到达了登录页面?我已经使用了alert来检查,但它甚至是fire alert。。所以我不能说登录页面上已经有了。。但我已经将其设置为我的网站的默认页面。并以::的形式输入画布url。如果Facebook没有将您发送到正确的登录页面,那么您在设置url时犯了一些错误。。。请仔细检查画布url是否正确。。。你能在这里发布画布链接吗?它是“http://”wishisdone.visionswiters.com/wishisdone/“我已经添加了”以正确显示url
<script type='text/javascript'>
if (top.location!= self.location)
{
top.location = self.location
}
</script>