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

· 11년 전 · 1529
<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,654
10년 전 조회 2,484
10년 전 조회 1,899
10년 전 조회 1,993
10년 전 조회 1,057
10년 전 조회 1,336
10년 전 조회 1,310
10년 전 조회 942
10년 전 조회 749
10년 전 조회 941
10년 전 조회 1,640
10년 전 조회 978
10년 전 조회 1,887
10년 전 조회 3,648
10년 전 조회 1,463
10년 전 조회 1,316
10년 전 조회 1,278
10년 전 조회 1,252
10년 전 조회 926
10년 전 조회 2,123
10년 전 조회 830
10년 전 조회 1,278
10년 전 조회 1,374
10년 전 조회 1,453
10년 전 조회 2,471
10년 전 조회 1,178
10년 전 조회 1,642
11년 전 조회 1,053
11년 전 조회 1,066
11년 전 조회 1,933
11년 전 조회 1,358
11년 전 조회 1,155
11년 전 조회 1,542
11년 전 조회 897
11년 전 조회 1,345
11년 전 조회 1,472
11년 전 조회 4,547
11년 전 조회 1,216
11년 전 조회 937
11년 전 조회 3,474
11년 전 조회 1,445
11년 전 조회 1,212
11년 전 조회 792
11년 전 조회 793
11년 전 조회 1,696
11년 전 조회 4,054
11년 전 조회 2,211
11년 전 조회 1,062
11년 전 조회 583
11년 전 조회 1,529
11년 전 조회 1,560
11년 전 조회 3,444
11년 전 조회 1,243
11년 전 조회 3,007
11년 전 조회 2,163
11년 전 조회 903
11년 전 조회 1,180
11년 전 조회 2,701
11년 전 조회 1,277
11년 전 조회 1,496
11년 전 조회 2,393
11년 전 조회 2,185
11년 전 조회 942
11년 전 조회 1,090
11년 전 조회 3,410
11년 전 조회 1,371
11년 전 조회 1,434
11년 전 조회 1,086
11년 전 조회 695
11년 전 조회 942
11년 전 조회 1,297
11년 전 조회 2,661
11년 전 조회 1,197
11년 전 조회 1,549
11년 전 조회 1,210
11년 전 조회 996
11년 전 조회 4,083
11년 전 조회 1,061
11년 전 조회 1,291
11년 전 조회 944
11년 전 조회 1,334
11년 전 조회 1,002
11년 전 조회 601
11년 전 조회 708
11년 전 조회 1,169
11년 전 조회 1,248
11년 전 조회 1,252
11년 전 조회 1,295
11년 전 조회 907
11년 전 조회 991
11년 전 조회 3,775
11년 전 조회 1,607
11년 전 조회 550
11년 전 조회 976
11년 전 조회 825
11년 전 조회 2,198
11년 전 조회 694
11년 전 조회 877
11년 전 조회 571
11년 전 조회 957
🐛 버그신고