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

· 11년 전 · 1584
<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,708
10년 전 조회 2,534
10년 전 조회 1,954
10년 전 조회 2,051
10년 전 조회 1,112
10년 전 조회 1,394
10년 전 조회 1,356
10년 전 조회 989
10년 전 조회 795
10년 전 조회 990
10년 전 조회 1,705
10년 전 조회 1,029
10년 전 조회 1,948
10년 전 조회 3,713
10년 전 조회 1,521
10년 전 조회 1,381
10년 전 조회 1,330
10년 전 조회 1,312
10년 전 조회 982
10년 전 조회 2,173
10년 전 조회 895
10년 전 조회 1,328
10년 전 조회 1,437
10년 전 조회 1,506
11년 전 조회 2,529
11년 전 조회 1,236
11년 전 조회 1,697
11년 전 조회 1,101
11년 전 조회 1,123
11년 전 조회 1,984
11년 전 조회 1,407
11년 전 조회 1,207
11년 전 조회 1,602
11년 전 조회 956
11년 전 조회 1,410
11년 전 조회 1,526
11년 전 조회 4,607
11년 전 조회 1,269
11년 전 조회 993
11년 전 조회 3,530
11년 전 조회 1,502
11년 전 조회 1,270
11년 전 조회 842
11년 전 조회 856
11년 전 조회 1,753
11년 전 조회 4,113
11년 전 조회 2,269
11년 전 조회 1,125
11년 전 조회 651
11년 전 조회 1,585
11년 전 조회 1,618
11년 전 조회 3,501
11년 전 조회 1,307
11년 전 조회 3,075
11년 전 조회 2,227
11년 전 조회 965
11년 전 조회 1,237
11년 전 조회 2,757
11년 전 조회 1,342
11년 전 조회 1,560
11년 전 조회 2,456
11년 전 조회 2,254
11년 전 조회 1,000
11년 전 조회 1,149
11년 전 조회 3,470
11년 전 조회 1,432
11년 전 조회 1,499
11년 전 조회 1,136
11년 전 조회 748
11년 전 조회 1,000
11년 전 조회 1,355
11년 전 조회 2,733
11년 전 조회 1,259
11년 전 조회 1,614
11년 전 조회 1,278
11년 전 조회 1,050
11년 전 조회 4,137
11년 전 조회 1,111
11년 전 조회 1,351
11년 전 조회 1,017
11년 전 조회 1,399
11년 전 조회 1,065
11년 전 조회 665
11년 전 조회 770
11년 전 조회 1,229
11년 전 조회 1,316
11년 전 조회 1,316
11년 전 조회 1,363
11년 전 조회 968
11년 전 조회 1,051
11년 전 조회 3,843
11년 전 조회 1,672
11년 전 조회 620
11년 전 조회 1,039
11년 전 조회 884
11년 전 조회 2,261
11년 전 조회 770
11년 전 조회 942
11년 전 조회 634
11년 전 조회 1,022
🐛 버그신고