내가 다음 코드에서 페이스 북 자바 스크립트 SDK를 사용하기 위해 노력하고있어,하지만 경고가 표시되지 않습니다, 상관없이 fbAsyncInit에 나는 ...fbAsyncInit가 실행되지 않는 이유는 무엇입니까?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '205116556256919', // App ID
channelUrl : 'http://lolkitten.org/', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional initialization code here
alert('loading complete');
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<fb:like send="true" width="450" show_faces="true" />
</html>
코드가 예상대로 작동합니다. (Btw,'channelUrl'은 JS-SDK가 포함 된 HTML 파일 인 크로스 도메인 채널 파일의 URL이어야하며 실행중인 응용 프로그램과 동일한 도메인에 위치하므로 전체 사이트 홈페이지 만 사용하면됩니다.) –