-5
我已經實施了來自facebook-invite-friends-api的Facebook邀請函,但我無法獲得他們如何重定向到我的網站,因爲他們(9lesson)已從facebook通知中演示。 請幫我,我該怎麼做。如何從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>
我的登錄頁面代碼:
<script type='text/javascript'>
if (top.location != self.location) {
top.location = self.location
}
</script>
我在登錄頁面中添加了上面的代碼,但我無法獲得所需的結果... –
控制檯中是否存在任何JS錯誤?用戶是否真的到達了登錄頁面? – Lix
我已經使用警報檢查,但它甚至是火警....所以我不能說它到達登錄頁面..但我已將其設置爲我的網站的默認頁面。並輸入畫布網址:: http://subdomain.domian.com/foldername/ –