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

· 11년 전 · 1485
<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,615
10년 전 조회 2,449
10년 전 조회 1,862
10년 전 조회 1,963
10년 전 조회 1,024
10년 전 조회 1,300
10년 전 조회 1,273
10년 전 조회 915
10년 전 조회 708
10년 전 조회 910
10년 전 조회 1,615
10년 전 조회 942
10년 전 조회 1,855
10년 전 조회 3,619
10년 전 조회 1,433
10년 전 조회 1,286
10년 전 조회 1,240
10년 전 조회 1,215
10년 전 조회 889
10년 전 조회 2,082
10년 전 조회 804
10년 전 조회 1,243
10년 전 조회 1,335
10년 전 조회 1,415
10년 전 조회 2,436
10년 전 조회 1,136
10년 전 조회 1,612
11년 전 조회 1,014
11년 전 조회 1,033
11년 전 조회 1,894
11년 전 조회 1,322
11년 전 조회 1,120
11년 전 조회 1,510
11년 전 조회 857
11년 전 조회 1,312
11년 전 조회 1,439
11년 전 조회 4,510
11년 전 조회 1,175
11년 전 조회 910
11년 전 조회 3,435
11년 전 조회 1,403
11년 전 조회 1,170
11년 전 조회 748
11년 전 조회 757
11년 전 조회 1,667
11년 전 조회 4,026
11년 전 조회 2,171
11년 전 조회 1,027
11년 전 조회 558
11년 전 조회 1,486
11년 전 조회 1,520
11년 전 조회 3,406
11년 전 조회 1,203
11년 전 조회 2,974
11년 전 조회 2,130
11년 전 조회 866
11년 전 조회 1,142
11년 전 조회 2,668
11년 전 조회 1,239
11년 전 조회 1,457
11년 전 조회 2,359
11년 전 조회 2,147
11년 전 조회 912
11년 전 조회 1,061
11년 전 조회 3,374
11년 전 조회 1,328
11년 전 조회 1,393
11년 전 조회 1,059
11년 전 조회 658
11년 전 조회 903
11년 전 조회 1,257
11년 전 조회 2,621
11년 전 조회 1,171
11년 전 조회 1,508
11년 전 조회 1,179
11년 전 조회 952
11년 전 조회 4,043
11년 전 조회 1,022
11년 전 조회 1,258
11년 전 조회 911
11년 전 조회 1,303
11년 전 조회 972
11년 전 조회 563
11년 전 조회 676
11년 전 조회 1,137
11년 전 조회 1,216
11년 전 조회 1,219
11년 전 조회 1,267
11년 전 조회 874
11년 전 조회 957
11년 전 조회 3,746
11년 전 조회 1,575
11년 전 조회 517
11년 전 조회 944
11년 전 조회 784
11년 전 조회 2,158
11년 전 조회 660
11년 전 조회 841
11년 전 조회 538
11년 전 조회 928
🐛 버그신고