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

· 11년 전 · 1422
<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,539
10년 전 조회 2,370
10년 전 조회 1,797
10년 전 조회 1,907
10년 전 조회 955
10년 전 조회 1,241
10년 전 조회 1,204
10년 전 조회 859
10년 전 조회 633
10년 전 조회 836
10년 전 조회 1,565
10년 전 조회 883
10년 전 조회 1,795
10년 전 조회 3,567
10년 전 조회 1,366
10년 전 조회 1,222
10년 전 조회 1,178
10년 전 조회 1,153
10년 전 조회 820
10년 전 조회 2,021
10년 전 조회 738
10년 전 조회 1,178
10년 전 조회 1,274
10년 전 조회 1,356
10년 전 조회 2,384
10년 전 조회 1,074
10년 전 조회 1,544
10년 전 조회 949
10년 전 조회 971
10년 전 조회 1,835
11년 전 조회 1,257
11년 전 조회 1,055
11년 전 조회 1,466
11년 전 조회 795
11년 전 조회 1,256
11년 전 조회 1,381
11년 전 조회 4,459
11년 전 조회 1,113
11년 전 조회 848
11년 전 조회 3,369
11년 전 조회 1,340
11년 전 조회 1,107
11년 전 조회 691
11년 전 조회 703
11년 전 조회 1,606
11년 전 조회 3,965
11년 전 조회 2,121
11년 전 조회 968
11년 전 조회 498
11년 전 조회 1,423
11년 전 조회 1,465
11년 전 조회 3,351
11년 전 조회 1,154
11년 전 조회 2,936
11년 전 조회 2,080
11년 전 조회 805
11년 전 조회 1,093
11년 전 조회 2,616
11년 전 조회 1,192
11년 전 조회 1,411
11년 전 조회 2,304
11년 전 조회 2,098
11년 전 조회 863
11년 전 조회 1,009
11년 전 조회 3,331
11년 전 조회 1,283
11년 전 조회 1,347
11년 전 조회 1,005
11년 전 조회 629
11년 전 조회 850
11년 전 조회 1,207
11년 전 조회 2,576
11년 전 조회 1,124
11년 전 조회 1,465
11년 전 조회 1,126
11년 전 조회 900
11년 전 조회 3,987
11년 전 조회 964
11년 전 조회 1,205
11년 전 조회 863
11년 전 조회 1,251
11년 전 조회 921
11년 전 조회 511
11년 전 조회 628
11년 전 조회 1,091
11년 전 조회 1,164
11년 전 조회 1,170
11년 전 조회 1,213
11년 전 조회 826
11년 전 조회 913
11년 전 조회 3,693
11년 전 조회 1,528
11년 전 조회 470
11년 전 조회 902
11년 전 조회 741
11년 전 조회 2,125
11년 전 조회 613
11년 전 조회 795
11년 전 조회 494
11년 전 조회 879
🐛 버그신고