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

· 11년 전 · 1494
<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,618
10년 전 조회 2,456
10년 전 조회 1,868
10년 전 조회 1,967
10년 전 조회 1,028
10년 전 조회 1,310
10년 전 조회 1,280
10년 전 조회 921
10년 전 조회 716
10년 전 조회 914
10년 전 조회 1,622
10년 전 조회 947
10년 전 조회 1,860
10년 전 조회 3,628
10년 전 조회 1,436
10년 전 조회 1,290
10년 전 조회 1,245
10년 전 조회 1,216
10년 전 조회 891
10년 전 조회 2,088
10년 전 조회 812
10년 전 조회 1,246
10년 전 조회 1,341
10년 전 조회 1,420
10년 전 조회 2,444
10년 전 조회 1,141
10년 전 조회 1,619
11년 전 조회 1,019
11년 전 조회 1,036
11년 전 조회 1,899
11년 전 조회 1,325
11년 전 조회 1,123
11년 전 조회 1,520
11년 전 조회 862
11년 전 조회 1,318
11년 전 조회 1,444
11년 전 조회 4,514
11년 전 조회 1,180
11년 전 조회 913
11년 전 조회 3,443
11년 전 조회 1,411
11년 전 조회 1,178
11년 전 조회 750
11년 전 조회 766
11년 전 조회 1,672
11년 전 조회 4,029
11년 전 조회 2,178
11년 전 조회 1,030
11년 전 조회 563
11년 전 조회 1,495
11년 전 조회 1,526
11년 전 조회 3,411
11년 전 조회 1,207
11년 전 조회 2,976
11년 전 조회 2,137
11년 전 조회 870
11년 전 조회 1,147
11년 전 조회 2,673
11년 전 조회 1,243
11년 전 조회 1,461
11년 전 조회 2,364
11년 전 조회 2,150
11년 전 조회 917
11년 전 조회 1,064
11년 전 조회 3,378
11년 전 조회 1,333
11년 전 조회 1,397
11년 전 조회 1,063
11년 전 조회 663
11년 전 조회 909
11년 전 조회 1,265
11년 전 조회 2,629
11년 전 조회 1,177
11년 전 조회 1,515
11년 전 조회 1,182
11년 전 조회 958
11년 전 조회 4,048
11년 전 조회 1,028
11년 전 조회 1,260
11년 전 조회 916
11년 전 조회 1,306
11년 전 조회 975
11년 전 조회 569
11년 전 조회 682
11년 전 조회 1,141
11년 전 조회 1,218
11년 전 조회 1,223
11년 전 조회 1,270
11년 전 조회 881
11년 전 조회 964
11년 전 조회 3,749
11년 전 조회 1,578
11년 전 조회 523
11년 전 조회 951
11년 전 조회 791
11년 전 조회 2,163
11년 전 조회 664
11년 전 조회 847
11년 전 조회 543
11년 전 조회 931
🐛 버그신고