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

· 11년 전 · 1427
<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

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

 

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

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

 

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

감사합니다.

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

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 1,546
10년 전 조회 2,377
10년 전 조회 1,804
10년 전 조회 1,911
10년 전 조회 961
10년 전 조회 1,247
10년 전 조회 1,210
10년 전 조회 863
10년 전 조회 641
10년 전 조회 846
10년 전 조회 1,569
10년 전 조회 888
10년 전 조회 1,801
10년 전 조회 3,569
10년 전 조회 1,370
10년 전 조회 1,227
10년 전 조회 1,184
10년 전 조회 1,159
10년 전 조회 827
10년 전 조회 2,026
10년 전 조회 743
10년 전 조회 1,183
10년 전 조회 1,279
10년 전 조회 1,360
10년 전 조회 2,388
10년 전 조회 1,082
10년 전 조회 1,551
10년 전 조회 955
10년 전 조회 976
10년 전 조회 1,840
11년 전 조회 1,263
11년 전 조회 1,058
11년 전 조회 1,468
11년 전 조회 801
11년 전 조회 1,262
11년 전 조회 1,388
11년 전 조회 4,464
11년 전 조회 1,121
11년 전 조회 856
11년 전 조회 3,376
11년 전 조회 1,346
11년 전 조회 1,113
11년 전 조회 700
11년 전 조회 707
11년 전 조회 1,611
11년 전 조회 3,973
11년 전 조회 2,125
11년 전 조회 975
11년 전 조회 503
11년 전 조회 1,428
11년 전 조회 1,471
11년 전 조회 3,354
11년 전 조회 1,158
11년 전 조회 2,939
11년 전 조회 2,083
11년 전 조회 813
11년 전 조회 1,096
11년 전 조회 2,623
11년 전 조회 1,197
11년 전 조회 1,414
11년 전 조회 2,309
11년 전 조회 2,103
11년 전 조회 868
11년 전 조회 1,016
11년 전 조회 3,336
11년 전 조회 1,290
11년 전 조회 1,354
11년 전 조회 1,013
11년 전 조회 634
11년 전 조회 857
11년 전 조회 1,215
11년 전 조회 2,581
11년 전 조회 1,133
11년 전 조회 1,470
11년 전 조회 1,132
11년 전 조회 906
11년 전 조회 3,993
11년 전 조회 971
11년 전 조회 1,210
11년 전 조회 868
11년 전 조회 1,261
11년 전 조회 926
11년 전 조회 519
11년 전 조회 632
11년 전 조회 1,096
11년 전 조회 1,169
11년 전 조회 1,177
11년 전 조회 1,221
11년 전 조회 830
11년 전 조회 921
11년 전 조회 3,699
11년 전 조회 1,533
11년 전 조회 476
11년 전 조회 908
11년 전 조회 746
11년 전 조회 2,129
11년 전 조회 620
11년 전 조회 801
11년 전 조회 501
11년 전 조회 882
🐛 버그신고