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

· 11년 전 · 1517
<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,642
10년 전 조회 2,477
10년 전 조회 1,888
10년 전 조회 1,984
10년 전 조회 1,047
10년 전 조회 1,324
10년 전 조회 1,300
10년 전 조회 937
10년 전 조회 739
10년 전 조회 932
10년 전 조회 1,633
10년 전 조회 968
10년 전 조회 1,878
10년 전 조회 3,642
10년 전 조회 1,454
10년 전 조회 1,307
10년 전 조회 1,266
10년 전 조회 1,239
10년 전 조회 918
10년 전 조회 2,111
10년 전 조회 826
10년 전 조회 1,267
10년 전 조회 1,363
10년 전 조회 1,441
10년 전 조회 2,460
10년 전 조회 1,163
10년 전 조회 1,634
11년 전 조회 1,041
11년 전 조회 1,056
11년 전 조회 1,919
11년 전 조회 1,349
11년 전 조회 1,144
11년 전 조회 1,535
11년 전 조회 884
11년 전 조회 1,338
11년 전 조회 1,466
11년 전 조회 4,538
11년 전 조회 1,205
11년 전 조회 928
11년 전 조회 3,466
11년 전 조회 1,435
11년 전 조회 1,201
11년 전 조회 780
11년 전 조회 782
11년 전 조회 1,687
11년 전 조회 4,042
11년 전 조회 2,199
11년 전 조회 1,050
11년 전 조회 573
11년 전 조회 1,518
11년 전 조회 1,545
11년 전 조회 3,433
11년 전 조회 1,225
11년 전 조회 3,002
11년 전 조회 2,152
11년 전 조회 887
11년 전 조회 1,166
11년 전 조회 2,688
11년 전 조회 1,260
11년 전 조회 1,484
11년 전 조회 2,381
11년 전 조회 2,174
11년 전 조회 934
11년 전 조회 1,086
11년 전 조회 3,397
11년 전 조회 1,353
11년 전 조회 1,419
11년 전 조회 1,078
11년 전 조회 685
11년 전 조회 928
11년 전 조회 1,283
11년 전 조회 2,648
11년 전 조회 1,193
11년 전 조회 1,532
11년 전 조회 1,198
11년 전 조회 984
11년 전 조회 4,072
11년 전 조회 1,049
11년 전 조회 1,278
11년 전 조회 936
11년 전 조회 1,327
11년 전 조회 997
11년 전 조회 591
11년 전 조회 698
11년 전 조회 1,157
11년 전 조회 1,238
11년 전 조회 1,236
11년 전 조회 1,284
11년 전 조회 900
11년 전 조회 983
11년 전 조회 3,766
11년 전 조회 1,595
11년 전 조회 545
11년 전 조회 966
11년 전 조회 814
11년 전 조회 2,187
11년 전 조회 681
11년 전 조회 865
11년 전 조회 561
11년 전 조회 944
🐛 버그신고