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

· 11년 전 · 1433
<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,550
10년 전 조회 2,384
10년 전 조회 1,810
10년 전 조회 1,916
10년 전 조회 966
10년 전 조회 1,251
10년 전 조회 1,218
10년 전 조회 871
10년 전 조회 646
10년 전 조회 850
10년 전 조회 1,573
10년 전 조회 895
10년 전 조회 1,806
10년 전 조회 3,571
10년 전 조회 1,375
10년 전 조회 1,233
10년 전 조회 1,190
10년 전 조회 1,167
10년 전 조회 832
10년 전 조회 2,031
10년 전 조회 753
10년 전 조회 1,187
10년 전 조회 1,282
10년 전 조회 1,366
10년 전 조회 2,394
10년 전 조회 1,087
10년 전 조회 1,557
10년 전 조회 960
10년 전 조회 981
10년 전 조회 1,846
11년 전 조회 1,267
11년 전 조회 1,063
11년 전 조회 1,469
11년 전 조회 803
11년 전 조회 1,267
11년 전 조회 1,390
11년 전 조회 4,467
11년 전 조회 1,123
11년 전 조회 862
11년 전 조회 3,380
11년 전 조회 1,350
11년 전 조회 1,116
11년 전 조회 703
11년 전 조회 710
11년 전 조회 1,620
11년 전 조회 3,976
11년 전 조회 2,129
11년 전 조회 981
11년 전 조회 505
11년 전 조회 1,434
11년 전 조회 1,474
11년 전 조회 3,358
11년 전 조회 1,161
11년 전 조회 2,943
11년 전 조회 2,086
11년 전 조회 815
11년 전 조회 1,102
11년 전 조회 2,625
11년 전 조회 1,201
11년 전 조회 1,420
11년 전 조회 2,310
11년 전 조회 2,106
11년 전 조회 873
11년 전 조회 1,021
11년 전 조회 3,341
11년 전 조회 1,291
11년 전 조회 1,356
11년 전 조회 1,016
11년 전 조회 635
11년 전 조회 862
11년 전 조회 1,219
11년 전 조회 2,583
11년 전 조회 1,136
11년 전 조회 1,472
11년 전 조회 1,133
11년 전 조회 912
11년 전 조회 3,998
11년 전 조회 974
11년 전 조회 1,216
11년 전 조회 874
11년 전 조회 1,262
11년 전 조회 929
11년 전 조회 521
11년 전 조회 636
11년 전 조회 1,103
11년 전 조회 1,174
11년 전 조회 1,179
11년 전 조회 1,224
11년 전 조회 835
11년 전 조회 926
11년 전 조회 3,705
11년 전 조회 1,537
11년 전 조회 481
11년 전 조회 912
11년 전 조회 753
11년 전 조회 2,132
11년 전 조회 623
11년 전 조회 807
11년 전 조회 503
11년 전 조회 885
🐛 버그신고