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

· 11년 전 · 1532
<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,656
10년 전 조회 2,485
10년 전 조회 1,902
10년 전 조회 1,997
10년 전 조회 1,064
10년 전 조회 1,339
10년 전 조회 1,316
10년 전 조회 943
10년 전 조회 753
10년 전 조회 948
10년 전 조회 1,643
10년 전 조회 984
10년 전 조회 1,891
10년 전 조회 3,653
10년 전 조회 1,466
10년 전 조회 1,320
10년 전 조회 1,283
10년 전 조회 1,253
10년 전 조회 928
10년 전 조회 2,128
10년 전 조회 834
10년 전 조회 1,282
10년 전 조회 1,378
10년 전 조회 1,458
10년 전 조회 2,473
10년 전 조회 1,178
10년 전 조회 1,646
11년 전 조회 1,057
11년 전 조회 1,070
11년 전 조회 1,938
11년 전 조회 1,360
11년 전 조회 1,158
11년 전 조회 1,545
11년 전 조회 899
11년 전 조회 1,348
11년 전 조회 1,475
11년 전 조회 4,550
11년 전 조회 1,224
11년 전 조회 941
11년 전 조회 3,482
11년 전 조회 1,449
11년 전 조회 1,216
11년 전 조회 795
11년 전 조회 796
11년 전 조회 1,702
11년 전 조회 4,060
11년 전 조회 2,214
11년 전 조회 1,071
11년 전 조회 591
11년 전 조회 1,533
11년 전 조회 1,562
11년 전 조회 3,447
11년 전 조회 1,252
11년 전 조회 3,011
11년 전 조회 2,170
11년 전 조회 904
11년 전 조회 1,187
11년 전 조회 2,703
11년 전 조회 1,283
11년 전 조회 1,501
11년 전 조회 2,396
11년 전 조회 2,191
11년 전 조회 943
11년 전 조회 1,094
11년 전 조회 3,414
11년 전 조회 1,374
11년 전 조회 1,440
11년 전 조회 1,091
11년 전 조회 700
11년 전 조회 944
11년 전 조회 1,303
11년 전 조회 2,669
11년 전 조회 1,202
11년 전 조회 1,555
11년 전 조회 1,215
11년 전 조회 1,001
11년 전 조회 4,087
11년 전 조회 1,065
11년 전 조회 1,298
11년 전 조회 949
11년 전 조회 1,336
11년 전 조회 1,005
11년 전 조회 605
11년 전 조회 717
11년 전 조회 1,173
11년 전 조회 1,253
11년 전 조회 1,256
11년 전 조회 1,302
11년 전 조회 916
11년 전 조회 997
11년 전 조회 3,780
11년 전 조회 1,608
11년 전 조회 556
11년 전 조회 981
11년 전 조회 828
11년 전 조회 2,201
11년 전 조회 698
11년 전 조회 880
11년 전 조회 576
11년 전 조회 962
🐛 버그신고