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

· 11년 전 · 1449
<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,572
10년 전 조회 2,406
10년 전 조회 1,823
10년 전 조회 1,929
10년 전 조회 983
10년 전 조회 1,264
10년 전 조회 1,236
10년 전 조회 886
10년 전 조회 666
10년 전 조회 869
10년 전 조회 1,579
10년 전 조회 908
10년 전 조회 1,818
10년 전 조회 3,577
10년 전 조회 1,397
10년 전 조회 1,252
10년 전 조회 1,205
10년 전 조회 1,178
10년 전 조회 843
10년 전 조회 2,046
10년 전 조회 768
10년 전 조회 1,207
10년 전 조회 1,296
10년 전 조회 1,379
10년 전 조회 2,404
10년 전 조회 1,100
10년 전 조회 1,570
10년 전 조회 979
11년 전 조회 995
11년 전 조회 1,859
11년 전 조회 1,277
11년 전 조회 1,074
11년 전 조회 1,479
11년 전 조회 821
11년 전 조회 1,282
11년 전 조회 1,404
11년 전 조회 4,474
11년 전 조회 1,139
11년 전 조회 872
11년 전 조회 3,398
11년 전 조회 1,367
11년 전 조회 1,133
11년 전 조회 714
11년 전 조회 723
11년 전 조회 1,633
11년 전 조회 3,992
11년 전 조회 2,140
11년 전 조회 996
11년 전 조회 522
11년 전 조회 1,450
11년 전 조회 1,487
11년 전 조회 3,372
11년 전 조회 1,168
11년 전 조회 2,952
11년 전 조회 2,097
11년 전 조회 830
11년 전 조회 1,110
11년 전 조회 2,638
11년 전 조회 1,209
11년 전 조회 1,427
11년 전 조회 2,326
11년 전 조회 2,121
11년 전 조회 888
11년 전 조회 1,031
11년 전 조회 3,347
11년 전 조회 1,300
11년 전 조회 1,366
11년 전 조회 1,026
11년 전 조회 637
11년 전 조회 874
11년 전 조회 1,231
11년 전 조회 2,591
11년 전 조회 1,143
11년 전 조회 1,480
11년 전 조회 1,150
11년 전 조회 923
11년 전 조회 4,013
11년 전 조회 988
11년 전 조회 1,228
11년 전 조회 886
11년 전 조회 1,272
11년 전 조회 944
11년 전 조회 539
11년 전 조회 649
11년 전 조회 1,116
11년 전 조회 1,188
11년 전 조회 1,192
11년 전 조회 1,238
11년 전 조회 846
11년 전 조회 938
11년 전 조회 3,716
11년 전 조회 1,546
11년 전 조회 492
11년 전 조회 917
11년 전 조회 764
11년 전 조회 2,137
11년 전 조회 634
11년 전 조회 821
11년 전 조회 513
11년 전 조회 901
🐛 버그신고