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

· 11년 전 · 1590
<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,713
10년 전 조회 2,546
10년 전 조회 1,965
10년 전 조회 2,062
10년 전 조회 1,122
10년 전 조회 1,405
10년 전 조회 1,364
10년 전 조회 1,000
10년 전 조회 808
10년 전 조회 998
10년 전 조회 1,714
10년 전 조회 1,036
10년 전 조회 1,953
10년 전 조회 3,720
10년 전 조회 1,529
10년 전 조회 1,384
10년 전 조회 1,337
10년 전 조회 1,321
10년 전 조회 990
10년 전 조회 2,178
10년 전 조회 906
10년 전 조회 1,338
10년 전 조회 1,443
10년 전 조회 1,514
11년 전 조회 2,536
11년 전 조회 1,241
11년 전 조회 1,705
11년 전 조회 1,112
11년 전 조회 1,128
11년 전 조회 1,996
11년 전 조회 1,416
11년 전 조회 1,220
11년 전 조회 1,616
11년 전 조회 963
11년 전 조회 1,417
11년 전 조회 1,535
11년 전 조회 4,617
11년 전 조회 1,280
11년 전 조회 1,002
11년 전 조회 3,535
11년 전 조회 1,512
11년 전 조회 1,283
11년 전 조회 851
11년 전 조회 860
11년 전 조회 1,762
11년 전 조회 4,123
11년 전 조회 2,278
11년 전 조회 1,135
11년 전 조회 664
11년 전 조회 1,591
11년 전 조회 1,622
11년 전 조회 3,511
11년 전 조회 1,317
11년 전 조회 3,085
11년 전 조회 2,236
11년 전 조회 974
11년 전 조회 1,246
11년 전 조회 2,770
11년 전 조회 1,360
11년 전 조회 1,578
11년 전 조회 2,472
11년 전 조회 2,260
11년 전 조회 1,009
11년 전 조회 1,160
11년 전 조회 3,479
11년 전 조회 1,443
11년 전 조회 1,508
11년 전 조회 1,144
11년 전 조회 758
11년 전 조회 1,011
11년 전 조회 1,368
11년 전 조회 2,745
11년 전 조회 1,271
11년 전 조회 1,629
11년 전 조회 1,283
11년 전 조회 1,059
11년 전 조회 4,143
11년 전 조회 1,125
11년 전 조회 1,364
11년 전 조회 1,021
11년 전 조회 1,405
11년 전 조회 1,072
11년 전 조회 673
11년 전 조회 783
11년 전 조회 1,236
11년 전 조회 1,329
11년 전 조회 1,328
11년 전 조회 1,370
11년 전 조회 981
11년 전 조회 1,057
11년 전 조회 3,853
11년 전 조회 1,686
11년 전 조회 630
11년 전 조회 1,049
11년 전 조회 889
11년 전 조회 2,276
11년 전 조회 775
11년 전 조회 949
11년 전 조회 654
11년 전 조회 1,033
🐛 버그신고