페이스북 공유하기 소스 분석좀 부탁드려요.

· 11년 전 · 2584
<html>
<head>
</head>
<body>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ko_KR/all.js#xfbml=1&appId=354047521446386";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script>
window.fbAsyncInit = function() {
FB.init({
appId      : '354047521446386', // 앱 ID
status     : true,          // 로그인 상태를 확인
cookie     : true,          // 쿠키허용
xfbml      : true           // parse XFBML
});

FB.Event.subscribe('auth.login', function(response) {
document.location.reload();
});

};
</script>

<button class="share-btn">test</button>

<script>
document.querySelector('body').onclick = function(){

var params = {};
params['message'] = 'message';
params['name'] = 'name';
params['description'] = 'description';
params['link'] = 'http://description.co.kr';
params['caption'] = 'caption';
  
FB.api('/me/feed', 'post', params, function(response) {
  if (!response || response.error) {
    alert('Error occured');
  } else {
    alert('Published to stream - you might want to delete it now!');
  }
});


};
</script>
</body>

</html>

 

이렇게 실행하면 Error occured

이렇게 에러를 뿌려버립니다.

 

잘되는 소스코드가 있긴하나..

별 문제 없어보이는데 왜 안될까 싶네요..

 

만들어보신분 답변 부탁드립니다.

감사합니다.

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
11년 전 조회 2,776
11년 전 조회 3,625
11년 전 조회 3,012
11년 전 조회 3,101
11년 전 조회 2,212
11년 전 조회 2,475
11년 전 조회 2,422
11년 전 조회 2,096
11년 전 조회 1,914
11년 전 조회 2,078
11년 전 조회 2,776
11년 전 조회 2,073
11년 전 조회 3,026
11년 전 조회 4,732
11년 전 조회 2,576
11년 전 조회 2,454
11년 전 조회 2,417
11년 전 조회 2,370
11년 전 조회 2,041
11년 전 조회 3,236
11년 전 조회 1,951
11년 전 조회 2,371
11년 전 조회 2,454
11년 전 조회 2,532
11년 전 조회 3,522
11년 전 조회 2,249
11년 전 조회 2,714
11년 전 조회 2,119
11년 전 조회 2,127
11년 전 조회 3,022
11년 전 조회 2,401
11년 전 조회 2,238
11년 전 조회 2,589
11년 전 조회 1,933
11년 전 조회 2,390
11년 전 조회 2,508
11년 전 조회 5,565
11년 전 조회 2,279
11년 전 조회 1,944
11년 전 조회 4,504
11년 전 조회 2,473
11년 전 조회 2,252
11년 전 조회 1,826
11년 전 조회 1,820
11년 전 조회 2,685
11년 전 조회 5,117
11년 전 조회 3,228
11년 전 조회 2,091
11년 전 조회 1,639
11년 전 조회 2,585
11년 전 조회 2,575
11년 전 조회 4,477
11년 전 조회 2,275
11년 전 조회 4,044
11년 전 조회 3,200
11년 전 조회 1,909
11년 전 조회 2,205
11년 전 조회 3,726
11년 전 조회 2,301
11년 전 조회 2,513
11년 전 조회 3,393
11년 전 조회 3,234
11년 전 조회 1,956
11년 전 조회 2,166
11년 전 조회 4,456
11년 전 조회 2,444
11년 전 조회 2,511
11년 전 조회 2,147
11년 전 조회 1,698
11년 전 조회 2,012
11년 전 조회 2,374
11년 전 조회 3,757
11년 전 조회 2,310
11년 전 조회 2,608
11년 전 조회 2,343
11년 전 조회 2,094
11년 전 조회 5,169
11년 전 조회 2,133
11년 전 조회 2,386
11년 전 조회 2,076
11년 전 조회 2,465
11년 전 조회 2,115
11년 전 조회 1,726
11년 전 조회 1,724
11년 전 조회 2,197
11년 전 조회 2,263
11년 전 조회 2,294
11년 전 조회 2,324
11년 전 조회 1,968
11년 전 조회 2,047
11년 전 조회 4,841
11년 전 조회 2,669
11년 전 조회 1,591
11년 전 조회 2,038
11년 전 조회 1,871
11년 전 조회 3,226
11년 전 조회 1,758
11년 전 조회 1,901
11년 전 조회 1,634
11년 전 조회 1,998