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

· 11년 전 · 1451
<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,575
10년 전 조회 2,410
10년 전 조회 1,825
10년 전 조회 1,931
10년 전 조회 986
10년 전 조회 1,266
10년 전 조회 1,238
10년 전 조회 886
10년 전 조회 667
10년 전 조회 871
10년 전 조회 1,580
10년 전 조회 911
10년 전 조회 1,820
10년 전 조회 3,579
10년 전 조회 1,398
10년 전 조회 1,253
10년 전 조회 1,207
10년 전 조회 1,179
10년 전 조회 846
10년 전 조회 2,047
10년 전 조회 768
10년 전 조회 1,209
10년 전 조회 1,299
10년 전 조회 1,380
10년 전 조회 2,405
10년 전 조회 1,101
10년 전 조회 1,573
10년 전 조회 982
11년 전 조회 996
11년 전 조회 1,861
11년 전 조회 1,279
11년 전 조회 1,076
11년 전 조회 1,480
11년 전 조회 823
11년 전 조회 1,285
11년 전 조회 1,406
11년 전 조회 4,476
11년 전 조회 1,140
11년 전 조회 873
11년 전 조회 3,399
11년 전 조회 1,368
11년 전 조회 1,134
11년 전 조회 715
11년 전 조회 726
11년 전 조회 1,635
11년 전 조회 3,992
11년 전 조회 2,141
11년 전 조회 998
11년 전 조회 524
11년 전 조회 1,452
11년 전 조회 1,490
11년 전 조회 3,374
11년 전 조회 1,169
11년 전 조회 2,952
11년 전 조회 2,100
11년 전 조회 833
11년 전 조회 1,112
11년 전 조회 2,638
11년 전 조회 1,211
11년 전 조회 1,428
11년 전 조회 2,328
11년 전 조회 2,121
11년 전 조회 889
11년 전 조회 1,031
11년 전 조회 3,347
11년 전 조회 1,300
11년 전 조회 1,366
11년 전 조회 1,027
11년 전 조회 637
11년 전 조회 876
11년 전 조회 1,231
11년 전 조회 2,591
11년 전 조회 1,144
11년 전 조회 1,481
11년 전 조회 1,150
11년 전 조회 923
11년 전 조회 4,013
11년 전 조회 990
11년 전 조회 1,229
11년 전 조회 886
11년 전 조회 1,272
11년 전 조회 944
11년 전 조회 539
11년 전 조회 649
11년 전 조회 1,116
11년 전 조회 1,188
11년 전 조회 1,192
11년 전 조회 1,238
11년 전 조회 846
11년 전 조회 938
11년 전 조회 3,717
11년 전 조회 1,546
11년 전 조회 492
11년 전 조회 918
11년 전 조회 764
11년 전 조회 2,137
11년 전 조회 634
11년 전 조회 821
11년 전 조회 514
11년 전 조회 901
🐛 버그신고