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

· 11년 전 · 1436
<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,555
10년 전 조회 2,386
10년 전 조회 1,815
10년 전 조회 1,918
10년 전 조회 968
10년 전 조회 1,253
10년 전 조회 1,220
10년 전 조회 871
10년 전 조회 649
10년 전 조회 853
10년 전 조회 1,574
10년 전 조회 897
10년 전 조회 1,807
10년 전 조회 3,571
10년 전 조회 1,376
10년 전 조회 1,234
10년 전 조회 1,191
10년 전 조회 1,169
10년 전 조회 832
10년 전 조회 2,033
10년 전 조회 754
10년 전 조회 1,188
10년 전 조회 1,285
10년 전 조회 1,368
10년 전 조회 2,395
10년 전 조회 1,088
10년 전 조회 1,558
10년 전 조회 960
10년 전 조회 981
10년 전 조회 1,847
11년 전 조회 1,267
11년 전 조회 1,065
11년 전 조회 1,470
11년 전 조회 806
11년 전 조회 1,268
11년 전 조회 1,390
11년 전 조회 4,467
11년 전 조회 1,126
11년 전 조회 864
11년 전 조회 3,383
11년 전 조회 1,354
11년 전 조회 1,120
11년 전 조회 704
11년 전 조회 712
11년 전 조회 1,621
11년 전 조회 3,977
11년 전 조회 2,130
11년 전 조회 982
11년 전 조회 510
11년 전 조회 1,437
11년 전 조회 1,476
11년 전 조회 3,359
11년 전 조회 1,163
11년 전 조회 2,943
11년 전 조회 2,086
11년 전 조회 817
11년 전 조회 1,104
11년 전 조회 2,625
11년 전 조회 1,201
11년 전 조회 1,420
11년 전 조회 2,311
11년 전 조회 2,108
11년 전 조회 876
11년 전 조회 1,022
11년 전 조회 3,341
11년 전 조회 1,293
11년 전 조회 1,360
11년 전 조회 1,017
11년 전 조회 636
11년 전 조회 862
11년 전 조회 1,219
11년 전 조회 2,585
11년 전 조회 1,136
11년 전 조회 1,473
11년 전 조회 1,134
11년 전 조회 912
11년 전 조회 3,999
11년 전 조회 976
11년 전 조회 1,217
11년 전 조회 874
11년 전 조회 1,262
11년 전 조회 929
11년 전 조회 523
11년 전 조회 637
11년 전 조회 1,104
11년 전 조회 1,176
11년 전 조회 1,180
11년 전 조회 1,226
11년 전 조회 837
11년 전 조회 927
11년 전 조회 3,707
11년 전 조회 1,537
11년 전 조회 482
11년 전 조회 912
11년 전 조회 753
11년 전 조회 2,133
11년 전 조회 626
11년 전 조회 807
11년 전 조회 504
11년 전 조회 886
🐛 버그신고