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

· 11년 전 · 1490
<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,616
10년 전 조회 2,454
10년 전 조회 1,865
10년 전 조회 1,966
10년 전 조회 1,027
10년 전 조회 1,306
10년 전 조회 1,276
10년 전 조회 919
10년 전 조회 712
10년 전 조회 913
10년 전 조회 1,617
10년 전 조회 947
10년 전 조회 1,857
10년 전 조회 3,622
10년 전 조회 1,435
10년 전 조회 1,288
10년 전 조회 1,243
10년 전 조회 1,215
10년 전 조회 890
10년 전 조회 2,086
10년 전 조회 807
10년 전 조회 1,245
10년 전 조회 1,338
10년 전 조회 1,418
10년 전 조회 2,440
10년 전 조회 1,139
10년 전 조회 1,614
11년 전 조회 1,018
11년 전 조회 1,034
11년 전 조회 1,897
11년 전 조회 1,323
11년 전 조회 1,121
11년 전 조회 1,515
11년 전 조회 859
11년 전 조회 1,317
11년 전 조회 1,442
11년 전 조회 4,513
11년 전 조회 1,177
11년 전 조회 912
11년 전 조회 3,439
11년 전 조회 1,408
11년 전 조회 1,174
11년 전 조회 749
11년 전 조회 761
11년 전 조회 1,670
11년 전 조회 4,027
11년 전 조회 2,173
11년 전 조회 1,029
11년 전 조회 562
11년 전 조회 1,491
11년 전 조회 1,523
11년 전 조회 3,409
11년 전 조회 1,205
11년 전 조회 2,975
11년 전 조회 2,133
11년 전 조회 868
11년 전 조회 1,144
11년 전 조회 2,669
11년 전 조회 1,240
11년 전 조회 1,459
11년 전 조회 2,360
11년 전 조회 2,149
11년 전 조회 913
11년 전 조회 1,062
11년 전 조회 3,376
11년 전 조회 1,332
11년 전 조회 1,395
11년 전 조회 1,062
11년 전 조회 659
11년 전 조회 906
11년 전 조회 1,260
11년 전 조회 2,625
11년 전 조회 1,175
11년 전 조회 1,511
11년 전 조회 1,180
11년 전 조회 955
11년 전 조회 4,045
11년 전 조회 1,025
11년 전 조회 1,259
11년 전 조회 912
11년 전 조회 1,304
11년 전 조회 973
11년 전 조회 566
11년 전 조회 680
11년 전 조회 1,138
11년 전 조회 1,217
11년 전 조회 1,220
11년 전 조회 1,268
11년 전 조회 879
11년 전 조회 961
11년 전 조회 3,748
11년 전 조회 1,577
11년 전 조회 520
11년 전 조회 947
11년 전 조회 788
11년 전 조회 2,161
11년 전 조회 661
11년 전 조회 844
11년 전 조회 541
11년 전 조회 930
🐛 버그신고