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

· 11년 전 · 1545
<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,669
10년 전 조회 2,495
10년 전 조회 1,912
10년 전 조회 2,014
10년 전 조회 1,075
10년 전 조회 1,351
10년 전 조회 1,325
10년 전 조회 953
10년 전 조회 766
10년 전 조회 962
10년 전 조회 1,655
10년 전 조회 993
10년 전 조회 1,904
10년 전 조회 3,664
10년 전 조회 1,481
10년 전 조회 1,340
10년 전 조회 1,298
10년 전 조회 1,268
10년 전 조회 940
10년 전 조회 2,140
10년 전 조회 851
10년 전 조회 1,296
10년 전 조회 1,394
10년 전 조회 1,470
10년 전 조회 2,491
10년 전 조회 1,192
10년 전 조회 1,661
11년 전 조회 1,071
11년 전 조회 1,083
11년 전 조회 1,950
11년 전 조회 1,369
11년 전 조회 1,168
11년 전 조회 1,555
11년 전 조회 918
11년 전 조회 1,362
11년 전 조회 1,488
11년 전 조회 4,567
11년 전 조회 1,238
11년 전 조회 956
11년 전 조회 3,496
11년 전 조회 1,464
11년 전 조회 1,234
11년 전 조회 810
11년 전 조회 809
11년 전 조회 1,713
11년 전 조회 4,071
11년 전 조회 2,226
11년 전 조회 1,084
11년 전 조회 606
11년 전 조회 1,546
11년 전 조회 1,580
11년 전 조회 3,461
11년 전 조회 1,259
11년 전 조회 3,031
11년 전 조회 2,185
11년 전 조회 922
11년 전 조회 1,196
11년 전 조회 2,719
11년 전 조회 1,298
11년 전 조회 1,518
11년 전 조회 2,415
11년 전 조회 2,207
11년 전 조회 960
11년 전 조회 1,107
11년 전 조회 3,426
11년 전 조회 1,383
11년 전 조회 1,452
11년 전 조회 1,102
11년 전 조회 712
11년 전 조회 960
11년 전 조회 1,318
11년 전 조회 2,682
11년 전 조회 1,219
11년 전 조회 1,568
11년 전 조회 1,228
11년 전 조회 1,014
11년 전 조회 4,099
11년 전 조회 1,078
11년 전 조회 1,319
11년 전 조회 964
11년 전 조회 1,350
11년 전 조회 1,021
11년 전 조회 618
11년 전 조회 730
11년 전 조회 1,188
11년 전 조회 1,278
11년 전 조회 1,278
11년 전 조회 1,323
11년 전 조회 927
11년 전 조회 1,012
11년 전 조회 3,795
11년 전 조회 1,622
11년 전 조회 571
11년 전 조회 997
11년 전 조회 849
11년 전 조회 2,220
11년 전 조회 719
11년 전 조회 897
11년 전 조회 589
11년 전 조회 973
🐛 버그신고