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

· 11년 전 · 1425
<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,544
10년 전 조회 2,374
10년 전 조회 1,799
10년 전 조회 1,909
10년 전 조회 958
10년 전 조회 1,244
10년 전 조회 1,209
10년 전 조회 862
10년 전 조회 638
10년 전 조회 841
10년 전 조회 1,566
10년 전 조회 886
10년 전 조회 1,798
10년 전 조회 3,567
10년 전 조회 1,369
10년 전 조회 1,224
10년 전 조회 1,182
10년 전 조회 1,156
10년 전 조회 824
10년 전 조회 2,025
10년 전 조회 742
10년 전 조회 1,182
10년 전 조회 1,277
10년 전 조회 1,359
10년 전 조회 2,384
10년 전 조회 1,075
10년 전 조회 1,549
10년 전 조회 954
10년 전 조회 974
10년 전 조회 1,839
11년 전 조회 1,261
11년 전 조회 1,056
11년 전 조회 1,468
11년 전 조회 799
11년 전 조회 1,258
11년 전 조회 1,387
11년 전 조회 4,462
11년 전 조회 1,117
11년 전 조회 852
11년 전 조회 3,375
11년 전 조회 1,345
11년 전 조회 1,112
11년 전 조회 695
11년 전 조회 706
11년 전 조회 1,608
11년 전 조회 3,969
11년 전 조회 2,123
11년 전 조회 970
11년 전 조회 500
11년 전 조회 1,426
11년 전 조회 1,469
11년 전 조회 3,352
11년 전 조회 1,156
11년 전 조회 2,938
11년 전 조회 2,082
11년 전 조회 810
11년 전 조회 1,095
11년 전 조회 2,620
11년 전 조회 1,195
11년 전 조회 1,414
11년 전 조회 2,308
11년 전 조회 2,103
11년 전 조회 865
11년 전 조회 1,013
11년 전 조회 3,332
11년 전 조회 1,285
11년 전 조회 1,351
11년 전 조회 1,010
11년 전 조회 632
11년 전 조회 854
11년 전 조회 1,211
11년 전 조회 2,579
11년 전 조회 1,129
11년 전 조회 1,469
11년 전 조회 1,130
11년 전 조회 904
11년 전 조회 3,991
11년 전 조회 970
11년 전 조회 1,209
11년 전 조회 865
11년 전 조회 1,256
11년 전 조회 924
11년 전 조회 518
11년 전 조회 632
11년 전 조회 1,093
11년 전 조회 1,168
11년 전 조회 1,174
11년 전 조회 1,216
11년 전 조회 830
11년 전 조회 918
11년 전 조회 3,698
11년 전 조회 1,531
11년 전 조회 475
11년 전 조회 906
11년 전 조회 743
11년 전 조회 2,129
11년 전 조회 616
11년 전 조회 800
11년 전 조회 498
11년 전 조회 882
🐛 버그신고