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

· 11년 전 · 1554
<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,676
10년 전 조회 2,506
10년 전 조회 1,924
10년 전 조회 2,022
10년 전 조회 1,087
10년 전 조회 1,366
10년 전 조회 1,330
10년 전 조회 965
10년 전 조회 770
10년 전 조회 967
10년 전 조회 1,670
10년 전 조회 1,003
10년 전 조회 1,919
10년 전 조회 3,680
10년 전 조회 1,489
10년 전 조회 1,349
10년 전 조회 1,305
10년 전 조회 1,284
10년 전 조회 945
10년 전 조회 2,147
10년 전 조회 863
10년 전 조회 1,304
10년 전 조회 1,406
10년 전 조회 1,478
10년 전 조회 2,502
10년 전 조회 1,206
10년 전 조회 1,669
11년 전 조회 1,079
11년 전 조회 1,095
11년 전 조회 1,959
11년 전 조회 1,373
11년 전 조회 1,174
11년 전 조회 1,565
11년 전 조회 921
11년 전 조회 1,374
11년 전 조회 1,494
11년 전 조회 4,582
11년 전 조회 1,247
11년 전 조회 964
11년 전 조회 3,504
11년 전 조회 1,469
11년 전 조회 1,240
11년 전 조회 819
11년 전 조회 817
11년 전 조회 1,724
11년 전 조회 4,083
11년 전 조회 2,235
11년 전 조회 1,096
11년 전 조회 616
11년 전 조회 1,555
11년 전 조회 1,593
11년 전 조회 3,475
11년 전 조회 1,267
11년 전 조회 3,043
11년 전 조회 2,193
11년 전 조회 939
11년 전 조회 1,205
11년 전 조회 2,733
11년 전 조회 1,308
11년 전 조회 1,530
11년 전 조회 2,428
11년 전 조회 2,217
11년 전 조회 971
11년 전 조회 1,121
11년 전 조회 3,437
11년 전 조회 1,394
11년 전 조회 1,464
11년 전 조회 1,113
11년 전 조회 721
11년 전 조회 970
11년 전 조회 1,331
11년 전 조회 2,697
11년 전 조회 1,233
11년 전 조회 1,578
11년 전 조회 1,243
11년 전 조회 1,022
11년 전 조회 4,108
11년 전 조회 1,086
11년 전 조회 1,326
11년 전 조회 982
11년 전 조회 1,364
11년 전 조회 1,032
11년 전 조회 627
11년 전 조회 740
11년 전 조회 1,197
11년 전 조회 1,287
11년 전 조회 1,289
11년 전 조회 1,335
11년 전 조회 939
11년 전 조회 1,024
11년 전 조회 3,810
11년 전 조회 1,636
11년 전 조회 584
11년 전 조회 1,011
11년 전 조회 861
11년 전 조회 2,235
11년 전 조회 733
11년 전 조회 909
11년 전 조회 605
11년 전 조회 983
🐛 버그신고