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

· 11년 전 · 2280
<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,417
11년 전 조회 3,285
11년 전 조회 2,691
11년 전 조회 2,788
11년 전 조회 1,856
11년 전 조회 2,140
11년 전 조회 2,093
11년 전 조회 1,750
11년 전 조회 1,560
11년 전 조회 1,740
11년 전 조회 2,510
11년 전 조회 1,751
11년 전 조회 2,710
11년 전 조회 4,434
11년 전 조회 2,267
11년 전 조회 2,109
11년 전 조회 2,068
11년 전 조회 2,038
11년 전 조회 1,711
11년 전 조회 2,915
11년 전 조회 1,616
11년 전 조회 2,018
11년 전 조회 2,136
11년 전 조회 2,190
11년 전 조회 3,208
11년 전 조회 1,935
11년 전 조회 2,433
11년 전 조회 1,805
11년 전 조회 1,800
11년 전 조회 2,680
11년 전 조회 2,072
11년 전 조회 1,898
11년 전 조회 2,334
11년 전 조회 1,611
11년 전 조회 2,072
11년 전 조회 2,176
11년 전 조회 5,272
11년 전 조회 1,974
11년 전 조회 1,645
11년 전 조회 4,197
11년 전 조회 2,177
11년 전 조회 1,924
11년 전 조회 1,526
11년 전 조회 1,546
11년 전 조회 2,431
11년 전 조회 4,805
11년 전 조회 2,925
11년 전 조회 1,785
11년 전 조회 1,339
11년 전 조회 2,281
11년 전 조회 2,290
11년 전 조회 4,161
11년 전 조회 1,957
11년 전 조회 3,740
11년 전 조회 2,923
11년 전 조회 1,627
11년 전 조회 1,926
11년 전 조회 3,445
11년 전 조회 2,014
11년 전 조회 2,237
11년 전 조회 3,129
11년 전 조회 2,914
11년 전 조회 1,676
11년 전 조회 1,838
11년 전 조회 4,182
11년 전 조회 2,162
11년 전 조회 2,236
11년 전 조회 1,836
11년 전 조회 1,403
11년 전 조회 1,717
11년 전 조회 2,075
11년 전 조회 3,431
11년 전 조회 1,965
11년 전 조회 2,322
11년 전 조회 2,026
11년 전 조회 1,765
11년 전 조회 4,885
11년 전 조회 1,830
11년 전 조회 2,074
11년 전 조회 1,737
11년 전 조회 2,115
11년 전 조회 1,797
11년 전 조회 1,396
11년 전 조회 1,433
11년 전 조회 1,904
11년 전 조회 1,949
11년 전 조회 1,984
11년 전 조회 2,011
11년 전 조회 1,643
11년 전 조회 1,726
11년 전 조회 4,505
11년 전 조회 2,358
11년 전 조회 1,299
11년 전 조회 1,727
11년 전 조회 1,565
11년 전 조회 2,960
11년 전 조회 1,436
11년 전 조회 1,605
11년 전 조회 1,316
11년 전 조회 1,716