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

· 11년 전 · 1443
<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,559
10년 전 조회 2,389
10년 전 조회 1,817
10년 전 조회 1,920
10년 전 조회 974
10년 전 조회 1,257
10년 전 조회 1,223
10년 전 조회 878
10년 전 조회 654
10년 전 조회 858
10년 전 조회 1,576
10년 전 조회 899
10년 전 조회 1,812
10년 전 조회 3,573
10년 전 조회 1,382
10년 전 조회 1,237
10년 전 조회 1,192
10년 전 조회 1,172
10년 전 조회 837
10년 전 조회 2,035
10년 전 조회 757
10년 전 조회 1,194
10년 전 조회 1,288
10년 전 조회 1,370
10년 전 조회 2,398
10년 전 조회 1,092
10년 전 조회 1,563
10년 전 조회 965
10년 전 조회 987
11년 전 조회 1,850
11년 전 조회 1,273
11년 전 조회 1,069
11년 전 조회 1,475
11년 전 조회 814
11년 전 조회 1,271
11년 전 조회 1,394
11년 전 조회 4,468
11년 전 조회 1,126
11년 전 조회 867
11년 전 조회 3,386
11년 전 조회 1,356
11년 전 조회 1,124
11년 전 조회 707
11년 전 조회 717
11년 전 조회 1,626
11년 전 조회 3,983
11년 전 조회 2,136
11년 전 조회 986
11년 전 조회 518
11년 전 조회 1,444
11년 전 조회 1,481
11년 전 조회 3,364
11년 전 조회 1,167
11년 전 조회 2,946
11년 전 조회 2,088
11년 전 조회 822
11년 전 조회 1,107
11년 전 조회 2,631
11년 전 조회 1,206
11년 전 조회 1,422
11년 전 조회 2,315
11년 전 조회 2,115
11년 전 조회 881
11년 전 조회 1,026
11년 전 조회 3,344
11년 전 조회 1,294
11년 전 조회 1,361
11년 전 조회 1,021
11년 전 조회 637
11년 전 조회 866
11년 전 조회 1,224
11년 전 조회 2,588
11년 전 조회 1,140
11년 전 조회 1,476
11년 전 조회 1,140
11년 전 조회 917
11년 전 조회 4,004
11년 전 조회 978
11년 전 조회 1,223
11년 전 조회 880
11년 전 조회 1,266
11년 전 조회 934
11년 전 조회 528
11년 전 조회 640
11년 전 조회 1,108
11년 전 조회 1,182
11년 전 조회 1,185
11년 전 조회 1,231
11년 전 조회 838
11년 전 조회 931
11년 전 조회 3,710
11년 전 조회 1,539
11년 전 조회 488
11년 전 조회 916
11년 전 조회 758
11년 전 조회 2,135
11년 전 조회 629
11년 전 조회 814
11년 전 조회 509
11년 전 조회 891
🐛 버그신고