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

· 11년 전 · 1445
<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,561
10년 전 조회 2,391
10년 전 조회 1,818
10년 전 조회 1,920
10년 전 조회 977
10년 전 조회 1,258
10년 전 조회 1,225
10년 전 조회 880
10년 전 조회 656
10년 전 조회 862
10년 전 조회 1,576
10년 전 조회 902
10년 전 조회 1,815
10년 전 조회 3,574
10년 전 조회 1,388
10년 전 조회 1,240
10년 전 조회 1,195
10년 전 조회 1,173
10년 전 조회 839
10년 전 조회 2,037
10년 전 조회 760
10년 전 조회 1,196
10년 전 조회 1,289
10년 전 조회 1,372
10년 전 조회 2,398
10년 전 조회 1,093
10년 전 조회 1,566
10년 전 조회 970
10년 전 조회 990
11년 전 조회 1,854
11년 전 조회 1,274
11년 전 조회 1,070
11년 전 조회 1,476
11년 전 조회 816
11년 전 조회 1,275
11년 전 조회 1,398
11년 전 조회 4,469
11년 전 조회 1,129
11년 전 조회 868
11년 전 조회 3,389
11년 전 조회 1,359
11년 전 조회 1,128
11년 전 조회 709
11년 전 조회 717
11년 전 조회 1,627
11년 전 조회 3,985
11년 전 조회 2,137
11년 전 조회 990
11년 전 조회 518
11년 전 조회 1,446
11년 전 조회 1,482
11년 전 조회 3,365
11년 전 조회 1,167
11년 전 조회 2,948
11년 전 조회 2,091
11년 전 조회 823
11년 전 조회 1,107
11년 전 조회 2,632
11년 전 조회 1,206
11년 전 조회 1,422
11년 전 조회 2,318
11년 전 조회 2,116
11년 전 조회 882
11년 전 조회 1,026
11년 전 조회 3,344
11년 전 조회 1,295
11년 전 조회 1,362
11년 전 조회 1,022
11년 전 조회 637
11년 전 조회 867
11년 전 조회 1,224
11년 전 조회 2,588
11년 전 조회 1,140
11년 전 조회 1,478
11년 전 조회 1,142
11년 전 조회 917
11년 전 조회 4,004
11년 전 조회 982
11년 전 조회 1,225
11년 전 조회 882
11년 전 조회 1,269
11년 전 조회 939
11년 전 조회 530
11년 전 조회 643
11년 전 조회 1,108
11년 전 조회 1,183
11년 전 조회 1,186
11년 전 조회 1,233
11년 전 조회 841
11년 전 조회 932
11년 전 조회 3,713
11년 전 조회 1,539
11년 전 조회 490
11년 전 조회 916
11년 전 조회 759
11년 전 조회 2,135
11년 전 조회 631
11년 전 조회 817
11년 전 조회 512
11년 전 조회 894
🐛 버그신고