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

· 11년 전 · 1428
<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,547
10년 전 조회 2,378
10년 전 조회 1,806
10년 전 조회 1,912
10년 전 조회 962
10년 전 조회 1,247
10년 전 조회 1,212
10년 전 조회 865
10년 전 조회 642
10년 전 조회 846
10년 전 조회 1,570
10년 전 조회 889
10년 전 조회 1,801
10년 전 조회 3,569
10년 전 조회 1,371
10년 전 조회 1,228
10년 전 조회 1,186
10년 전 조회 1,160
10년 전 조회 828
10년 전 조회 2,028
10년 전 조회 747
10년 전 조회 1,184
10년 전 조회 1,279
10년 전 조회 1,363
10년 전 조회 2,390
10년 전 조회 1,082
10년 전 조회 1,552
10년 전 조회 957
10년 전 조회 977
10년 전 조회 1,841
11년 전 조회 1,263
11년 전 조회 1,059
11년 전 조회 1,468
11년 전 조회 802
11년 전 조회 1,262
11년 전 조회 1,388
11년 전 조회 4,464
11년 전 조회 1,121
11년 전 조회 856
11년 전 조회 3,377
11년 전 조회 1,347
11년 전 조회 1,114
11년 전 조회 700
11년 전 조회 707
11년 전 조회 1,611
11년 전 조회 3,973
11년 전 조회 2,126
11년 전 조회 976
11년 전 조회 503
11년 전 조회 1,429
11년 전 조회 1,471
11년 전 조회 3,355
11년 전 조회 1,159
11년 전 조회 2,940
11년 전 조회 2,084
11년 전 조회 813
11년 전 조회 1,097
11년 전 조회 2,623
11년 전 조회 1,197
11년 전 조회 1,416
11년 전 조회 2,309
11년 전 조회 2,104
11년 전 조회 869
11년 전 조회 1,017
11년 전 조회 3,338
11년 전 조회 1,290
11년 전 조회 1,355
11년 전 조회 1,014
11년 전 조회 634
11년 전 조회 858
11년 전 조회 1,215
11년 전 조회 2,582
11년 전 조회 1,133
11년 전 조회 1,471
11년 전 조회 1,133
11년 전 조회 906
11년 전 조회 3,994
11년 전 조회 971
11년 전 조회 1,212
11년 전 조회 869
11년 전 조회 1,261
11년 전 조회 928
11년 전 조회 519
11년 전 조회 634
11년 전 조회 1,096
11년 전 조회 1,170
11년 전 조회 1,178
11년 전 조회 1,222
11년 전 조회 833
11년 전 조회 922
11년 전 조회 3,699
11년 전 조회 1,534
11년 전 조회 478
11년 전 조회 910
11년 전 조회 749
11년 전 조회 2,131
11년 전 조회 621
11년 전 조회 802
11년 전 조회 501
11년 전 조회 882
🐛 버그신고