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

· 11년 전 · 1438
<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,555
10년 전 조회 2,387
10년 전 조회 1,815
10년 전 조회 1,918
10년 전 조회 971
10년 전 조회 1,253
10년 전 조회 1,220
10년 전 조회 873
10년 전 조회 650
10년 전 조회 853
10년 전 조회 1,575
10년 전 조회 898
10년 전 조회 1,809
10년 전 조회 3,572
10년 전 조회 1,380
10년 전 조회 1,236
10년 전 조회 1,191
10년 전 조회 1,170
10년 전 조회 834
10년 전 조회 2,033
10년 전 조회 755
10년 전 조회 1,188
10년 전 조회 1,288
10년 전 조회 1,368
10년 전 조회 2,395
10년 전 조회 1,089
10년 전 조회 1,560
10년 전 조회 961
10년 전 조회 984
10년 전 조회 1,847
11년 전 조회 1,269
11년 전 조회 1,065
11년 전 조회 1,470
11년 전 조회 811
11년 전 조회 1,268
11년 전 조회 1,391
11년 전 조회 4,467
11년 전 조회 1,126
11년 전 조회 864
11년 전 조회 3,383
11년 전 조회 1,354
11년 전 조회 1,121
11년 전 조회 705
11년 전 조회 714
11년 전 조회 1,622
11년 전 조회 3,980
11년 전 조회 2,131
11년 전 조회 982
11년 전 조회 511
11년 전 조회 1,439
11년 전 조회 1,478
11년 전 조회 3,360
11년 전 조회 1,163
11년 전 조회 2,944
11년 전 조회 2,086
11년 전 조회 817
11년 전 조회 1,105
11년 전 조회 2,628
11년 전 조회 1,202
11년 전 조회 1,420
11년 전 조회 2,312
11년 전 조회 2,112
11년 전 조회 879
11년 전 조회 1,023
11년 전 조회 3,342
11년 전 조회 1,294
11년 전 조회 1,361
11년 전 조회 1,019
11년 전 조회 637
11년 전 조회 863
11년 전 조회 1,221
11년 전 조회 2,587
11년 전 조회 1,137
11년 전 조회 1,474
11년 전 조회 1,136
11년 전 조회 913
11년 전 조회 4,000
11년 전 조회 976
11년 전 조회 1,218
11년 전 조회 876
11년 전 조회 1,263
11년 전 조회 932
11년 전 조회 525
11년 전 조회 637
11년 전 조회 1,106
11년 전 조회 1,177
11년 전 조회 1,181
11년 전 조회 1,227
11년 전 조회 838
11년 전 조회 927
11년 전 조회 3,707
11년 전 조회 1,538
11년 전 조회 484
11년 전 조회 913
11년 전 조회 754
11년 전 조회 2,135
11년 전 조회 627
11년 전 조회 807
11년 전 조회 506
11년 전 조회 888
🐛 버그신고