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

· 11년 전 · 1523
<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,648
10년 전 조회 2,480
10년 전 조회 1,892
10년 전 조회 1,990
10년 전 조회 1,054
10년 전 조회 1,330
10년 전 조회 1,306
10년 전 조회 940
10년 전 조회 745
10년 전 조회 936
10년 전 조회 1,638
10년 전 조회 973
10년 전 조회 1,883
10년 전 조회 3,646
10년 전 조회 1,458
10년 전 조회 1,313
10년 전 조회 1,274
10년 전 조회 1,245
10년 전 조회 923
10년 전 조회 2,119
10년 전 조회 828
10년 전 조회 1,273
10년 전 조회 1,370
10년 전 조회 1,448
10년 전 조회 2,465
10년 전 조회 1,171
10년 전 조회 1,639
11년 전 조회 1,046
11년 전 조회 1,062
11년 전 조회 1,928
11년 전 조회 1,354
11년 전 조회 1,148
11년 전 조회 1,539
11년 전 조회 890
11년 전 조회 1,342
11년 전 조회 1,470
11년 전 조회 4,542
11년 전 조회 1,211
11년 전 조회 933
11년 전 조회 3,471
11년 전 조회 1,442
11년 전 조회 1,208
11년 전 조회 785
11년 전 조회 785
11년 전 조회 1,692
11년 전 조회 4,049
11년 전 조회 2,206
11년 전 조회 1,056
11년 전 조회 579
11년 전 조회 1,524
11년 전 조회 1,553
11년 전 조회 3,440
11년 전 조회 1,235
11년 전 조회 3,004
11년 전 조회 2,157
11년 전 조회 897
11년 전 조회 1,170
11년 전 조회 2,693
11년 전 조회 1,268
11년 전 조회 1,489
11년 전 조회 2,388
11년 전 조회 2,180
11년 전 조회 939
11년 전 조회 1,089
11년 전 조회 3,402
11년 전 조회 1,360
11년 전 조회 1,423
11년 전 조회 1,083
11년 전 조회 688
11년 전 조회 934
11년 전 조회 1,289
11년 전 조회 2,654
11년 전 조회 1,197
11년 전 조회 1,540
11년 전 조회 1,203
11년 전 조회 989
11년 전 조회 4,076
11년 전 조회 1,054
11년 전 조회 1,283
11년 전 조회 938
11년 전 조회 1,331
11년 전 조회 1,001
11년 전 조회 595
11년 전 조회 703
11년 전 조회 1,161
11년 전 조회 1,243
11년 전 조회 1,245
11년 전 조회 1,289
11년 전 조회 904
11년 전 조회 989
11년 전 조회 3,770
11년 전 조회 1,602
11년 전 조회 547
11년 전 조회 972
11년 전 조회 821
11년 전 조회 2,194
11년 전 조회 685
11년 전 조회 870
11년 전 조회 564
11년 전 조회 952
🐛 버그신고