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

· 11년 전 · 1461
<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,587
10년 전 조회 2,420
10년 전 조회 1,836
10년 전 조회 1,940
10년 전 조회 992
10년 전 조회 1,273
10년 전 조회 1,244
10년 전 조회 893
10년 전 조회 675
10년 전 조회 880
10년 전 조회 1,588
10년 전 조회 918
10년 전 조회 1,831
10년 전 조회 3,591
10년 전 조회 1,404
10년 전 조회 1,263
10년 전 조회 1,214
10년 전 조회 1,189
10년 전 조회 859
10년 전 조회 2,055
10년 전 조회 778
10년 전 조회 1,216
10년 전 조회 1,309
10년 전 조회 1,387
10년 전 조회 2,411
10년 전 조회 1,113
10년 전 조회 1,580
11년 전 조회 992
11년 전 조회 1,002
11년 전 조회 1,869
11년 전 조회 1,291
11년 전 조회 1,090
11년 전 조회 1,487
11년 전 조회 834
11년 전 조회 1,289
11년 전 조회 1,414
11년 전 조회 4,485
11년 전 조회 1,148
11년 전 조회 881
11년 전 조회 3,406
11년 전 조회 1,374
11년 전 조회 1,141
11년 전 조회 725
11년 전 조회 734
11년 전 조회 1,643
11년 전 조회 3,998
11년 전 조회 2,150
11년 전 조회 1,006
11년 전 조회 533
11년 전 조회 1,462
11년 전 조회 1,496
11년 전 조회 3,381
11년 전 조회 1,175
11년 전 조회 2,957
11년 전 조회 2,106
11년 전 조회 838
11년 전 조회 1,118
11년 전 조회 2,643
11년 전 조회 1,217
11년 전 조회 1,434
11년 전 조회 2,332
11년 전 조회 2,127
11년 전 조회 893
11년 전 조회 1,038
11년 전 조회 3,351
11년 전 조회 1,302
11년 전 조회 1,369
11년 전 조회 1,036
11년 전 조회 642
11년 전 조회 880
11년 전 조회 1,239
11년 전 조회 2,595
11년 전 조회 1,153
11년 전 조회 1,487
11년 전 조회 1,154
11년 전 조회 928
11년 전 조회 4,018
11년 전 조회 993
11년 전 조회 1,233
11년 전 조회 888
11년 전 조회 1,278
11년 전 조회 947
11년 전 조회 540
11년 전 조회 651
11년 전 조회 1,119
11년 전 조회 1,192
11년 전 조회 1,198
11년 전 조회 1,243
11년 전 조회 848
11년 전 조회 941
11년 전 조회 3,723
11년 전 조회 1,552
11년 전 조회 495
11년 전 조회 926
11년 전 조회 767
11년 전 조회 2,138
11년 전 조회 638
11년 전 조회 821
11년 전 조회 519
11년 전 조회 905
🐛 버그신고