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

· 11년 전 · 1446
<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,563
10년 전 조회 2,396
10년 전 조회 1,820
10년 전 조회 1,922
10년 전 조회 977
10년 전 조회 1,261
10년 전 조회 1,227
10년 전 조회 882
10년 전 조회 660
10년 전 조회 864
10년 전 조회 1,578
10년 전 조회 906
10년 전 조회 1,817
10년 전 조회 3,574
10년 전 조회 1,393
10년 전 조회 1,245
10년 전 조회 1,198
10년 전 조회 1,175
10년 전 조회 840
10년 전 조회 2,039
10년 전 조회 763
10년 전 조회 1,199
10년 전 조회 1,290
10년 전 조회 1,374
10년 전 조회 2,401
10년 전 조회 1,096
10년 전 조회 1,567
10년 전 조회 974
11년 전 조회 994
11년 전 조회 1,854
11년 전 조회 1,275
11년 전 조회 1,072
11년 전 조회 1,479
11년 전 조회 817
11년 전 조회 1,277
11년 전 조회 1,399
11년 전 조회 4,472
11년 전 조회 1,133
11년 전 조회 869
11년 전 조회 3,392
11년 전 조회 1,361
11년 전 조회 1,130
11년 전 조회 711
11년 전 조회 718
11년 전 조회 1,629
11년 전 조회 3,988
11년 전 조회 2,139
11년 전 조회 991
11년 전 조회 520
11년 전 조회 1,447
11년 전 조회 1,483
11년 전 조회 3,367
11년 전 조회 1,168
11년 전 조회 2,950
11년 전 조회 2,093
11년 전 조회 826
11년 전 조회 1,109
11년 전 조회 2,635
11년 전 조회 1,207
11년 전 조회 1,424
11년 전 조회 2,321
11년 전 조회 2,120
11년 전 조회 883
11년 전 조회 1,031
11년 전 조회 3,345
11년 전 조회 1,296
11년 전 조회 1,365
11년 전 조회 1,024
11년 전 조회 637
11년 전 조회 869
11년 전 조회 1,226
11년 전 조회 2,589
11년 전 조회 1,142
11년 전 조회 1,479
11년 전 조회 1,146
11년 전 조회 918
11년 전 조회 4,007
11년 전 조회 986
11년 전 조회 1,227
11년 전 조회 883
11년 전 조회 1,270
11년 전 조회 941
11년 전 조회 533
11년 전 조회 646
11년 전 조회 1,111
11년 전 조회 1,184
11년 전 조회 1,191
11년 전 조회 1,237
11년 전 조회 845
11년 전 조회 935
11년 전 조회 3,714
11년 전 조회 1,542
11년 전 조회 492
11년 전 조회 916
11년 전 조회 762
11년 전 조회 2,136
11년 전 조회 633
11년 전 조회 818
11년 전 조회 512
11년 전 조회 897
🐛 버그신고