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

· 11년 전 · 1458
<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,583
10년 전 조회 2,417
10년 전 조회 1,833
10년 전 조회 1,938
10년 전 조회 991
10년 전 조회 1,270
10년 전 조회 1,242
10년 전 조회 891
10년 전 조회 673
10년 전 조회 879
10년 전 조회 1,585
10년 전 조회 914
10년 전 조회 1,830
10년 전 조회 3,589
10년 전 조회 1,403
10년 전 조회 1,262
10년 전 조회 1,212
10년 전 조회 1,187
10년 전 조회 856
10년 전 조회 2,052
10년 전 조회 776
10년 전 조회 1,214
10년 전 조회 1,307
10년 전 조회 1,385
10년 전 조회 2,409
10년 전 조회 1,111
10년 전 조회 1,579
11년 전 조회 989
11년 전 조회 1,000
11년 전 조회 1,866
11년 전 조회 1,287
11년 전 조회 1,086
11년 전 조회 1,486
11년 전 조회 831
11년 전 조회 1,288
11년 전 조회 1,410
11년 전 조회 4,484
11년 전 조회 1,146
11년 전 조회 879
11년 전 조회 3,404
11년 전 조회 1,372
11년 전 조회 1,139
11년 전 조회 722
11년 전 조회 730
11년 전 조회 1,641
11년 전 조회 3,997
11년 전 조회 2,150
11년 전 조회 1,005
11년 전 조회 531
11년 전 조회 1,459
11년 전 조회 1,496
11년 전 조회 3,379
11년 전 조회 1,174
11년 전 조회 2,955
11년 전 조회 2,105
11년 전 조회 838
11년 전 조회 1,117
11년 전 조회 2,642
11년 전 조회 1,216
11년 전 조회 1,432
11년 전 조회 2,332
11년 전 조회 2,125
11년 전 조회 891
11년 전 조회 1,038
11년 전 조회 3,351
11년 전 조회 1,302
11년 전 조회 1,369
11년 전 조회 1,036
11년 전 조회 641
11년 전 조회 879
11년 전 조회 1,238
11년 전 조회 2,594
11년 전 조회 1,152
11년 전 조회 1,486
11년 전 조회 1,154
11년 전 조회 926
11년 전 조회 4,017
11년 전 조회 993
11년 전 조회 1,233
11년 전 조회 888
11년 전 조회 1,278
11년 전 조회 947
11년 전 조회 540
11년 전 조회 651
11년 전 조회 1,119
11년 전 조회 1,192
11년 전 조회 1,196
11년 전 조회 1,243
11년 전 조회 848
11년 전 조회 941
11년 전 조회 3,722
11년 전 조회 1,550
11년 전 조회 495
11년 전 조회 924
11년 전 조회 766
11년 전 조회 2,138
11년 전 조회 638
11년 전 조회 821
11년 전 조회 518
11년 전 조회 905
🐛 버그신고