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

· 11년 전 · 1474
<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,602
10년 전 조회 2,433
10년 전 조회 1,848
10년 전 조회 1,949
10년 전 조회 1,009
10년 전 조회 1,287
10년 전 조회 1,255
10년 전 조회 904
10년 전 조회 692
10년 전 조회 893
10년 전 조회 1,599
10년 전 조회 931
10년 전 조회 1,839
10년 전 조회 3,598
10년 전 조회 1,420
10년 전 조회 1,276
10년 전 조회 1,225
10년 전 조회 1,205
10년 전 조회 878
10년 전 조회 2,066
10년 전 조회 790
10년 전 조회 1,226
10년 전 조회 1,325
10년 전 조회 1,397
10년 전 조회 2,421
10년 전 조회 1,128
10년 전 조회 1,594
11년 전 조회 1,002
11년 전 조회 1,019
11년 전 조회 1,881
11년 전 조회 1,308
11년 전 조회 1,106
11년 전 조회 1,494
11년 전 조회 842
11년 전 조회 1,300
11년 전 조회 1,429
11년 전 조회 4,493
11년 전 조회 1,156
11년 전 조회 892
11년 전 조회 3,417
11년 전 조회 1,384
11년 전 조회 1,152
11년 전 조회 739
11년 전 조회 747
11년 전 조회 1,653
11년 전 조회 4,012
11년 전 조회 2,160
11년 전 조회 1,015
11년 전 조회 543
11년 전 조회 1,475
11년 전 조회 1,505
11년 전 조회 3,392
11년 전 조회 1,186
11년 전 조회 2,966
11년 전 조회 2,115
11년 전 조회 847
11년 전 조회 1,125
11년 전 조회 2,653
11년 전 조회 1,227
11년 전 조회 1,443
11년 전 조회 2,344
11년 전 조회 2,136
11년 전 조회 902
11년 전 조회 1,049
11년 전 조회 3,361
11년 전 조회 1,317
11년 전 조회 1,382
11년 전 조회 1,043
11년 전 조회 648
11년 전 조회 889
11년 전 조회 1,243
11년 전 조회 2,608
11년 전 조회 1,164
11년 전 조회 1,495
11년 전 조회 1,166
11년 전 조회 936
11년 전 조회 4,028
11년 전 조회 1,006
11년 전 조회 1,243
11년 전 조회 896
11년 전 조회 1,289
11년 전 조회 958
11년 전 조회 552
11년 전 조회 658
11년 전 조회 1,127
11년 전 조회 1,202
11년 전 조회 1,202
11년 전 조회 1,254
11년 전 조회 857
11년 전 조회 947
11년 전 조회 3,733
11년 전 조회 1,560
11년 전 조회 506
11년 전 조회 936
11년 전 조회 773
11년 전 조회 2,144
11년 전 조회 648
11년 전 조회 828
11년 전 조회 528
11년 전 조회 910
🐛 버그신고