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

· 11년 전 · 1487
<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,615
10년 전 조회 2,451
10년 전 조회 1,863
10년 전 조회 1,965
10년 전 조회 1,025
10년 전 조회 1,303
10년 전 조회 1,275
10년 전 조회 918
10년 전 조회 710
10년 전 조회 911
10년 전 조회 1,617
10년 전 조회 944
10년 전 조회 1,856
10년 전 조회 3,622
10년 전 조회 1,434
10년 전 조회 1,286
10년 전 조회 1,242
10년 전 조회 1,215
10년 전 조회 889
10년 전 조회 2,085
10년 전 조회 805
10년 전 조회 1,244
10년 전 조회 1,336
10년 전 조회 1,417
10년 전 조회 2,438
10년 전 조회 1,137
10년 전 조회 1,613
11년 전 조회 1,017
11년 전 조회 1,033
11년 전 조회 1,896
11년 전 조회 1,322
11년 전 조회 1,120
11년 전 조회 1,513
11년 전 조회 858
11년 전 조회 1,314
11년 전 조회 1,440
11년 전 조회 4,511
11년 전 조회 1,176
11년 전 조회 910
11년 전 조회 3,437
11년 전 조회 1,406
11년 전 조회 1,173
11년 전 조회 748
11년 전 조회 759
11년 전 조회 1,668
11년 전 조회 4,026
11년 전 조회 2,172
11년 전 조회 1,027
11년 전 조회 560
11년 전 조회 1,488
11년 전 조회 1,522
11년 전 조회 3,407
11년 전 조회 1,204
11년 전 조회 2,974
11년 전 조회 2,130
11년 전 조회 867
11년 전 조회 1,143
11년 전 조회 2,668
11년 전 조회 1,239
11년 전 조회 1,457
11년 전 조회 2,360
11년 전 조회 2,149
11년 전 조회 913
11년 전 조회 1,062
11년 전 조회 3,375
11년 전 조회 1,331
11년 전 조회 1,394
11년 전 조회 1,060
11년 전 조회 658
11년 전 조회 904
11년 전 조회 1,258
11년 전 조회 2,623
11년 전 조회 1,174
11년 전 조회 1,509
11년 전 조회 1,180
11년 전 조회 954
11년 전 조회 4,045
11년 전 조회 1,024
11년 전 조회 1,259
11년 전 조회 912
11년 전 조회 1,303
11년 전 조회 973
11년 전 조회 565
11년 전 조회 679
11년 전 조회 1,138
11년 전 조회 1,217
11년 전 조회 1,220
11년 전 조회 1,268
11년 전 조회 878
11년 전 조회 961
11년 전 조회 3,748
11년 전 조회 1,577
11년 전 조회 520
11년 전 조회 947
11년 전 조회 786
11년 전 조회 2,160
11년 전 조회 661
11년 전 조회 843
11년 전 조회 541
11년 전 조회 929
🐛 버그신고