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

· 11년 전 · 1553
<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,675
10년 전 조회 2,500
10년 전 조회 1,922
10년 전 조회 2,021
10년 전 조회 1,083
10년 전 조회 1,362
10년 전 조회 1,329
10년 전 조회 961
10년 전 조회 769
10년 전 조회 966
10년 전 조회 1,665
10년 전 조회 998
10년 전 조회 1,913
10년 전 조회 3,677
10년 전 조회 1,487
10년 전 조회 1,345
10년 전 조회 1,303
10년 전 조회 1,277
10년 전 조회 942
10년 전 조회 2,146
10년 전 조회 855
10년 전 조회 1,301
10년 전 조회 1,403
10년 전 조회 1,475
10년 전 조회 2,501
10년 전 조회 1,200
10년 전 조회 1,666
11년 전 조회 1,077
11년 전 조회 1,090
11년 전 조회 1,956
11년 전 조회 1,371
11년 전 조회 1,172
11년 전 조회 1,562
11년 전 조회 920
11년 전 조회 1,369
11년 전 조회 1,491
11년 전 조회 4,580
11년 전 조회 1,244
11년 전 조회 961
11년 전 조회 3,500
11년 전 조회 1,468
11년 전 조회 1,239
11년 전 조회 816
11년 전 조회 815
11년 전 조회 1,721
11년 전 조회 4,079
11년 전 조회 2,231
11년 전 조회 1,093
11년 전 조회 613
11년 전 조회 1,553
11년 전 조회 1,588
11년 전 조회 3,473
11년 전 조회 1,265
11년 전 조회 3,041
11년 전 조회 2,189
11년 전 조회 936
11년 전 조회 1,204
11년 전 조회 2,728
11년 전 조회 1,305
11년 전 조회 1,527
11년 전 조회 2,423
11년 전 조회 2,213
11년 전 조회 966
11년 전 조회 1,116
11년 전 조회 3,432
11년 전 조회 1,391
11년 전 조회 1,462
11년 전 조회 1,111
11년 전 조회 720
11년 전 조회 967
11년 전 조회 1,327
11년 전 조회 2,694
11년 전 조회 1,225
11년 전 조회 1,574
11년 전 조회 1,240
11년 전 조회 1,021
11년 전 조회 4,104
11년 전 조회 1,084
11년 전 조회 1,322
11년 전 조회 976
11년 전 조회 1,360
11년 전 조회 1,028
11년 전 조회 625
11년 전 조회 738
11년 전 조회 1,195
11년 전 조회 1,283
11년 전 조회 1,285
11년 전 조회 1,331
11년 전 조회 937
11년 전 조회 1,021
11년 전 조회 3,805
11년 전 조회 1,632
11년 전 조회 580
11년 전 조회 1,008
11년 전 조회 856
11년 전 조회 2,232
11년 전 조회 726
11년 전 조회 906
11년 전 조회 600
11년 전 조회 980
🐛 버그신고