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

· 11년 전 · 1434
<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,552
10년 전 조회 2,386
10년 전 조회 1,813
10년 전 조회 1,917
10년 전 조회 967
10년 전 조회 1,252
10년 전 조회 1,219
10년 전 조회 871
10년 전 조회 647
10년 전 조회 852
10년 전 조회 1,574
10년 전 조회 897
10년 전 조회 1,806
10년 전 조회 3,571
10년 전 조회 1,376
10년 전 조회 1,234
10년 전 조회 1,191
10년 전 조회 1,168
10년 전 조회 832
10년 전 조회 2,033
10년 전 조회 754
10년 전 조회 1,187
10년 전 조회 1,284
10년 전 조회 1,368
10년 전 조회 2,395
10년 전 조회 1,087
10년 전 조회 1,557
10년 전 조회 960
10년 전 조회 981
10년 전 조회 1,846
11년 전 조회 1,267
11년 전 조회 1,063
11년 전 조회 1,469
11년 전 조회 803
11년 전 조회 1,267
11년 전 조회 1,390
11년 전 조회 4,467
11년 전 조회 1,124
11년 전 조회 863
11년 전 조회 3,381
11년 전 조회 1,351
11년 전 조회 1,117
11년 전 조회 703
11년 전 조회 711
11년 전 조회 1,620
11년 전 조회 3,977
11년 전 조회 2,129
11년 전 조회 982
11년 전 조회 508
11년 전 조회 1,435
11년 전 조회 1,476
11년 전 조회 3,358
11년 전 조회 1,162
11년 전 조회 2,943
11년 전 조회 2,086
11년 전 조회 816
11년 전 조회 1,103
11년 전 조회 2,625
11년 전 조회 1,201
11년 전 조회 1,420
11년 전 조회 2,311
11년 전 조회 2,106
11년 전 조회 874
11년 전 조회 1,021
11년 전 조회 3,341
11년 전 조회 1,292
11년 전 조회 1,357
11년 전 조회 1,016
11년 전 조회 635
11년 전 조회 862
11년 전 조회 1,219
11년 전 조회 2,585
11년 전 조회 1,136
11년 전 조회 1,473
11년 전 조회 1,133
11년 전 조회 912
11년 전 조회 3,999
11년 전 조회 976
11년 전 조회 1,216
11년 전 조회 874
11년 전 조회 1,262
11년 전 조회 929
11년 전 조회 523
11년 전 조회 637
11년 전 조회 1,103
11년 전 조회 1,174
11년 전 조회 1,180
11년 전 조회 1,224
11년 전 조회 837
11년 전 조회 927
11년 전 조회 3,705
11년 전 조회 1,537
11년 전 조회 481
11년 전 조회 912
11년 전 조회 753
11년 전 조회 2,133
11년 전 조회 624
11년 전 조회 807
11년 전 조회 504
11년 전 조회 885
🐛 버그신고