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

· 11년 전 · 2544
<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,727
11년 전 조회 3,587
11년 전 조회 2,958
11년 전 조회 3,059
11년 전 조회 2,161
11년 전 조회 2,436
11년 전 조회 2,382
11년 전 조회 2,045
11년 전 조회 1,867
11년 전 조회 2,027
11년 전 조회 2,736
11년 전 조회 2,029
11년 전 조회 2,982
11년 전 조회 4,693
11년 전 조회 2,525
11년 전 조회 2,412
11년 전 조회 2,348
11년 전 조회 2,331
11년 전 조회 1,986
11년 전 조회 3,176
11년 전 조회 1,896
11년 전 조회 2,312
11년 전 조회 2,405
11년 전 조회 2,480
11년 전 조회 3,481
11년 전 조회 2,194
11년 전 조회 2,671
11년 전 조회 2,064
11년 전 조회 2,070
11년 전 조회 2,971
11년 전 조회 2,354
11년 전 조회 2,183
11년 전 조회 2,543
11년 전 조회 1,891
11년 전 조회 2,338
11년 전 조회 2,455
11년 전 조회 5,523
11년 전 조회 2,223
11년 전 조회 1,906
11년 전 조회 4,444
11년 전 조회 2,422
11년 전 조회 2,202
11년 전 조회 1,773
11년 전 조회 1,778
11년 전 조회 2,649
11년 전 조회 5,068
11년 전 조회 3,191
11년 전 조회 2,058
11년 전 조회 1,604
11년 전 조회 2,545
11년 전 조회 2,533
11년 전 조회 4,435
11년 전 조회 2,241
11년 전 조회 4,004
11년 전 조회 3,162
11년 전 조회 1,874
11년 전 조회 2,162
11년 전 조회 3,684
11년 전 조회 2,269
11년 전 조회 2,481
11년 전 조회 3,363
11년 전 조회 3,190
11년 전 조회 1,922
11년 전 조회 2,116
11년 전 조회 4,416
11년 전 조회 2,409
11년 전 조회 2,464
11년 전 조회 2,093
11년 전 조회 1,656
11년 전 조회 1,969
11년 전 조회 2,333
11년 전 조회 3,717
11년 전 조회 2,247
11년 전 조회 2,565
11년 전 조회 2,294
11년 전 조회 2,043
11년 전 조회 5,113
11년 전 조회 2,099
11년 전 조회 2,345
11년 전 조회 2,021
11년 전 조회 2,408
11년 전 조회 2,059
11년 전 조회 1,674
11년 전 조회 1,684
11년 전 조회 2,153
11년 전 조회 2,213
11년 전 조회 2,256
11년 전 조회 2,259
11년 전 조회 1,913
11년 전 조회 1,984
11년 전 조회 4,783
11년 전 조회 2,627
11년 전 조회 1,540
11년 전 조회 1,982
11년 전 조회 1,822
11년 전 조회 3,177
11년 전 조회 1,711
11년 전 조회 1,858
11년 전 조회 1,585
11년 전 조회 1,964