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

· 11년 전 · 1603
<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,724
10년 전 조회 2,560
10년 전 조회 1,980
10년 전 조회 2,070
10년 전 조회 1,135
10년 전 조회 1,412
10년 전 조회 1,374
10년 전 조회 1,020
10년 전 조회 820
10년 전 조회 1,015
10년 전 조회 1,727
10년 전 조회 1,061
10년 전 조회 1,971
10년 전 조회 3,732
10년 전 조회 1,541
10년 전 조회 1,396
10년 전 조회 1,354
10년 전 조회 1,333
10년 전 조회 1,007
10년 전 조회 2,190
10년 전 조회 924
10년 전 조회 1,352
11년 전 조회 1,457
11년 전 조회 1,530
11년 전 조회 2,548
11년 전 조회 1,257
11년 전 조회 1,718
11년 전 조회 1,132
11년 전 조회 1,151
11년 전 조회 2,014
11년 전 조회 1,433
11년 전 조회 1,230
11년 전 조회 1,623
11년 전 조회 976
11년 전 조회 1,436
11년 전 조회 1,549
11년 전 조회 4,632
11년 전 조회 1,295
11년 전 조회 1,017
11년 전 조회 3,546
11년 전 조회 1,525
11년 전 조회 1,295
11년 전 조회 869
11년 전 조회 880
11년 전 조회 1,781
11년 전 조회 4,140
11년 전 조회 2,293
11년 전 조회 1,147
11년 전 조회 681
11년 전 조회 1,604
11년 전 조회 1,641
11년 전 조회 3,529
11년 전 조회 1,325
11년 전 조회 3,096
11년 전 조회 2,250
11년 전 조회 987
11년 전 조회 1,262
11년 전 조회 2,788
11년 전 조회 1,369
11년 전 조회 1,584
11년 전 조회 2,487
11년 전 조회 2,272
11년 전 조회 1,031
11년 전 조회 1,174
11년 전 조회 3,497
11년 전 조회 1,459
11년 전 조회 1,521
11년 전 조회 1,164
11년 전 조회 770
11년 전 조회 1,028
11년 전 조회 1,384
11년 전 조회 2,755
11년 전 조회 1,287
11년 전 조회 1,638
11년 전 조회 1,300
11년 전 조회 1,081
11년 전 조회 4,159
11년 전 조회 1,148
11년 전 조회 1,384
11년 전 조회 1,040
11년 전 조회 1,425
11년 전 조회 1,084
11년 전 조회 685
11년 전 조회 799
11년 전 조회 1,255
11년 전 조회 1,341
11년 전 조회 1,346
11년 전 조회 1,396
11년 전 조회 998
11년 전 조회 1,070
11년 전 조회 3,864
11년 전 조회 1,707
11년 전 조회 646
11년 전 조회 1,071
11년 전 조회 905
11년 전 조회 2,288
11년 전 조회 794
11년 전 조회 969
11년 전 조회 666
11년 전 조회 1,051
🐛 버그신고