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

· 11년 전 · 2601
<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

이렇게 에러를 뿌려버립니다.

 

잘되는 소스코드가 있긴하나..

별 문제 없어보이는데 왜 안될까 싶네요..

 

만들어보신분 답변 부탁드립니다.

감사합니다.

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
11년 전 조회 2,791
11년 전 조회 3,645
11년 전 조회 3,023
11년 전 조회 3,114
11년 전 조회 2,231
11년 전 조회 2,490
11년 전 조회 2,440
11년 전 조회 2,116
11년 전 조회 1,932
11년 전 조회 2,100
11년 전 조회 2,794
11년 전 조회 2,084
11년 전 조회 3,038
11년 전 조회 4,746
11년 전 조회 2,598
11년 전 조회 2,464
11년 전 조회 2,433
11년 전 조회 2,381
11년 전 조회 2,057
11년 전 조회 3,246
11년 전 조회 1,963
11년 전 조회 2,386
11년 전 조회 2,461
11년 전 조회 2,551
11년 전 조회 3,534
11년 전 조회 2,262
11년 전 조회 2,730
11년 전 조회 2,131
11년 전 조회 2,144
11년 전 조회 3,033
11년 전 조회 2,422
11년 전 조회 2,254
11년 전 조회 2,609
11년 전 조회 1,949
11년 전 조회 2,409
11년 전 조회 2,528
11년 전 조회 5,585
11년 전 조회 2,294
11년 전 조회 1,964
11년 전 조회 4,524
11년 전 조회 2,495
11년 전 조회 2,266
11년 전 조회 1,849
11년 전 조회 1,836
11년 전 조회 2,696
11년 전 조회 5,132
11년 전 조회 3,245
11년 전 조회 2,109
11년 전 조회 1,653
11년 전 조회 2,602
11년 전 조회 2,592
11년 전 조회 4,509
11년 전 조회 2,286
11년 전 조회 4,059
11년 전 조회 3,215
11년 전 조회 1,922
11년 전 조회 2,229
11년 전 조회 3,737
11년 전 조회 2,308
11년 전 조회 2,529
11년 전 조회 3,410
11년 전 조회 3,243
11년 전 조회 1,976
11년 전 조회 2,185
11년 전 조회 4,479
11년 전 조회 2,463
11년 전 조회 2,531
11년 전 조회 2,170
11년 전 조회 1,712
11년 전 조회 2,026
11년 전 조회 2,395
11년 전 조회 3,775
11년 전 조회 2,334
11년 전 조회 2,630
11년 전 조회 2,365
11년 전 조회 2,110
11년 전 조회 5,182
11년 전 조회 2,151
11년 전 조회 2,402
11년 전 조회 2,086
11년 전 조회 2,486
11년 전 조회 2,132
11년 전 조회 1,745
11년 전 조회 1,740
11년 전 조회 2,218
11년 전 조회 2,279
11년 전 조회 2,312
11년 전 조회 2,335
11년 전 조회 1,986
11년 전 조회 2,061
11년 전 조회 4,859
11년 전 조회 2,689
11년 전 조회 1,616
11년 전 조회 2,057
11년 전 조회 1,887
11년 전 조회 3,239
11년 전 조회 1,776
11년 전 조회 1,921
11년 전 조회 1,652
11년 전 조회 2,009