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

· 11년 전 · 2528
<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,724
11년 전 조회 3,584
11년 전 조회 2,955
11년 전 조회 3,056
11년 전 조회 2,155
11년 전 조회 2,432
11년 전 조회 2,378
11년 전 조회 2,041
11년 전 조회 1,862
11년 전 조회 2,025
11년 전 조회 2,734
11년 전 조회 2,024
11년 전 조회 2,977
11년 전 조회 4,688
11년 전 조회 2,519
11년 전 조회 2,407
11년 전 조회 2,337
11년 전 조회 2,326
11년 전 조회 1,973
11년 전 조회 3,172
11년 전 조회 1,891
11년 전 조회 2,308
11년 전 조회 2,402
11년 전 조회 2,474
11년 전 조회 3,477
11년 전 조회 2,188
11년 전 조회 2,664
11년 전 조회 2,053
11년 전 조회 2,065
11년 전 조회 2,966
11년 전 조회 2,342
11년 전 조회 2,177
11년 전 조회 2,537
11년 전 조회 1,887
11년 전 조회 2,327
11년 전 조회 2,448
11년 전 조회 5,519
11년 전 조회 2,221
11년 전 조회 1,900
11년 전 조회 4,439
11년 전 조회 2,413
11년 전 조회 2,198
11년 전 조회 1,768
11년 전 조회 1,775
11년 전 조회 2,644
11년 전 조회 5,057
11년 전 조회 3,185
11년 전 조회 2,051
11년 전 조회 1,597
11년 전 조회 2,529
11년 전 조회 2,528
11년 전 조회 4,428
11년 전 조회 2,240
11년 전 조회 3,996
11년 전 조회 3,158
11년 전 조회 1,866
11년 전 조회 2,155
11년 전 조회 3,682
11년 전 조회 2,263
11년 전 조회 2,478
11년 전 조회 3,359
11년 전 조회 3,181
11년 전 조회 1,918
11년 전 조회 2,109
11년 전 조회 4,413
11년 전 조회 2,406
11년 전 조회 2,461
11년 전 조회 2,088
11년 전 조회 1,653
11년 전 조회 1,964
11년 전 조회 2,328
11년 전 조회 3,710
11년 전 조회 2,240
11년 전 조회 2,558
11년 전 조회 2,290
11년 전 조회 2,036
11년 전 조회 5,113
11년 전 조회 2,092
11년 전 조회 2,336
11년 전 조회 2,013
11년 전 조회 2,402
11년 전 조회 2,051
11년 전 조회 1,669
11년 전 조회 1,679
11년 전 조회 2,150
11년 전 조회 2,207
11년 전 조회 2,252
11년 전 조회 2,251
11년 전 조회 1,906
11년 전 조회 1,979
11년 전 조회 4,774
11년 전 조회 2,616
11년 전 조회 1,534
11년 전 조회 1,979
11년 전 조회 1,815
11년 전 조회 3,169
11년 전 조회 1,709
11년 전 조회 1,855
11년 전 조회 1,580
11년 전 조회 1,958