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

· 11년 전 · 1563
<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,687
10년 전 조회 2,512
10년 전 조회 1,932
10년 전 조회 2,029
10년 전 조회 1,092
10년 전 조회 1,374
10년 전 조회 1,336
10년 전 조회 972
10년 전 조회 775
10년 전 조회 972
10년 전 조회 1,681
10년 전 조회 1,008
10년 전 조회 1,927
10년 전 조회 3,686
10년 전 조회 1,495
10년 전 조회 1,357
10년 전 조회 1,311
10년 전 조회 1,293
10년 전 조회 951
10년 전 조회 2,152
10년 전 조회 876
10년 전 조회 1,310
10년 전 조회 1,416
10년 전 조회 1,483
10년 전 조회 2,509
10년 전 조회 1,214
10년 전 조회 1,677
11년 전 조회 1,082
11년 전 조회 1,099
11년 전 조회 1,966
11년 전 조회 1,382
11년 전 조회 1,186
11년 전 조회 1,580
11년 전 조회 935
11년 전 조회 1,384
11년 전 조회 1,502
11년 전 조회 4,591
11년 전 조회 1,253
11년 전 조회 974
11년 전 조회 3,509
11년 전 조회 1,476
11년 전 조회 1,247
11년 전 조회 826
11년 전 조회 827
11년 전 조회 1,734
11년 전 조회 4,088
11년 전 조회 2,248
11년 전 조회 1,105
11년 전 조회 623
11년 전 조회 1,564
11년 전 조회 1,597
11년 전 조회 3,487
11년 전 조회 1,279
11년 전 조회 3,052
11년 전 조회 2,205
11년 전 조회 947
11년 전 조회 1,211
11년 전 조회 2,738
11년 전 조회 1,317
11년 전 조회 1,538
11년 전 조회 2,435
11년 전 조회 2,232
11년 전 조회 980
11년 전 조회 1,130
11년 전 조회 3,446
11년 전 조회 1,406
11년 전 조회 1,475
11년 전 조회 1,117
11년 전 조회 731
11년 전 조회 978
11년 전 조회 1,335
11년 전 조회 2,708
11년 전 조회 1,241
11년 전 조회 1,589
11년 전 조회 1,249
11년 전 조회 1,029
11년 전 조회 4,116
11년 전 조회 1,093
11년 전 조회 1,332
11년 전 조회 988
11년 전 조회 1,376
11년 전 조회 1,042
11년 전 조회 640
11년 전 조회 748
11년 전 조회 1,203
11년 전 조회 1,294
11년 전 조회 1,299
11년 전 조회 1,345
11년 전 조회 946
11년 전 조회 1,032
11년 전 조회 3,819
11년 전 조회 1,645
11년 전 조회 593
11년 전 조회 1,020
11년 전 조회 867
11년 전 조회 2,242
11년 전 조회 743
11년 전 조회 919
11년 전 조회 612
11년 전 조회 994
🐛 버그신고