0
當試圖使用Facebook JS SDK時,我一直運行到錯誤FB undefined
。 當我通過IE瀏覽器上的JavaScript調試器觀察它時,它會在頁面加載過程中正確運行,最後它只是未定義,並且沒有訂閱的事件觸發。 目標:使頁面標籤刷新最頂層頁面,以通過粉絲大門。Facebook Javascript SDK FB未定義
關於我在這裏失蹤的任何想法?
代碼:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function(){
FB.init({
appId : 'APP CODE INSERTED HERE',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
channelUrl : 'URL to Channel .ASPX'
});
// Additional initialization code here
FB.Event.subscribe('edge.create',
function(response){
top.location.href = 'Page to refreshed inserted here';
});
};
(function(d)
{
var js, id = 'facebook-jssdk';
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document)
);
</script>