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

· 11년 전 · 1441
<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,558
10년 전 조회 2,389
10년 전 조회 1,815
10년 전 조회 1,920
10년 전 조회 972
10년 전 조회 1,255
10년 전 조회 1,221
10년 전 조회 875
10년 전 조회 653
10년 전 조회 855
10년 전 조회 1,576
10년 전 조회 899
10년 전 조회 1,812
10년 전 조회 3,573
10년 전 조회 1,382
10년 전 조회 1,237
10년 전 조회 1,192
10년 전 조회 1,170
10년 전 조회 835
10년 전 조회 2,034
10년 전 조회 757
10년 전 조회 1,192
10년 전 조회 1,288
10년 전 조회 1,369
10년 전 조회 2,396
10년 전 조회 1,090
10년 전 조회 1,562
10년 전 조회 963
10년 전 조회 985
11년 전 조회 1,849
11년 전 조회 1,271
11년 전 조회 1,066
11년 전 조회 1,473
11년 전 조회 811
11년 전 조회 1,271
11년 전 조회 1,393
11년 전 조회 4,467
11년 전 조회 1,126
11년 전 조회 865
11년 전 조회 3,385
11년 전 조회 1,355
11년 전 조회 1,123
11년 전 조회 706
11년 전 조회 716
11년 전 조회 1,623
11년 전 조회 3,981
11년 전 조회 2,134
11년 전 조회 984
11년 전 조회 515
11년 전 조회 1,442
11년 전 조회 1,480
11년 전 조회 3,362
11년 전 조회 1,164
11년 전 조회 2,945
11년 전 조회 2,087
11년 전 조회 820
11년 전 조회 1,106
11년 전 조회 2,630
11년 전 조회 1,203
11년 전 조회 1,420
11년 전 조회 2,314
11년 전 조회 2,113
11년 전 조회 880
11년 전 조회 1,025
11년 전 조회 3,343
11년 전 조회 1,294
11년 전 조회 1,361
11년 전 조회 1,021
11년 전 조회 637
11년 전 조회 866
11년 전 조회 1,223
11년 전 조회 2,588
11년 전 조회 1,139
11년 전 조회 1,475
11년 전 조회 1,139
11년 전 조회 917
11년 전 조회 4,004
11년 전 조회 976
11년 전 조회 1,222
11년 전 조회 879
11년 전 조회 1,264
11년 전 조회 933
11년 전 조회 528
11년 전 조회 639
11년 전 조회 1,108
11년 전 조회 1,181
11년 전 조회 1,183
11년 전 조회 1,230
11년 전 조회 838
11년 전 조회 930
11년 전 조회 3,709
11년 전 조회 1,539
11년 전 조회 486
11년 전 조회 915
11년 전 조회 758
11년 전 조회 2,135
11년 전 조회 627
11년 전 조회 811
11년 전 조회 507
11년 전 조회 891
🐛 버그신고