我有一個iframe應用程序的Facebook選項卡,並在該選項卡中有一個像Facebook按鈕有Facebook功能的第二個功能。這是一個普通的Facebook像按鈕iframe。用戶點擊facebook之後的重定向按鈕
當用戶單擊按鈕時,是否有重定向用戶的可能性?我試了下面的代碼:
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '<my app id>', status: true, cookie: true, xfbml: true});
FB.Canvas.setSize({ width: 520, height: 1500 });
FB.Event.subscribe('edge.create',
function(response) {
alert('like!');
}
);
};
//Load the SDK asynchronously
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
但是這不起作用。有沒有辦法或我做錯了什麼?
像按鈕一樣正常運作嗎? – jBit
可能的重複[如何重新定向一次facebook像按鈕被點擊?](http://stackoverflow.com/questions/6886102/how-can-i-redirect-once-facebook-like-button-is-clicked) – ifaour