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

· 11년 전 · 1541
<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,664
10년 전 조회 2,490
10년 전 조회 1,910
10년 전 조회 2,009
10년 전 조회 1,073
10년 전 조회 1,348
10년 전 조회 1,323
10년 전 조회 950
10년 전 조회 763
10년 전 조회 955
10년 전 조회 1,652
10년 전 조회 990
10년 전 조회 1,900
10년 전 조회 3,660
10년 전 조회 1,477
10년 전 조회 1,333
10년 전 조회 1,294
10년 전 조회 1,266
10년 전 조회 935
10년 전 조회 2,137
10년 전 조회 846
10년 전 조회 1,293
10년 전 조회 1,387
10년 전 조회 1,468
10년 전 조회 2,482
10년 전 조회 1,189
10년 전 조회 1,655
11년 전 조회 1,067
11년 전 조회 1,080
11년 전 조회 1,946
11년 전 조회 1,368
11년 전 조회 1,166
11년 전 조회 1,551
11년 전 조회 912
11년 전 조회 1,357
11년 전 조회 1,486
11년 전 조회 4,560
11년 전 조회 1,234
11년 전 조회 950
11년 전 조회 3,491
11년 전 조회 1,459
11년 전 조회 1,228
11년 전 조회 806
11년 전 조회 806
11년 전 조회 1,709
11년 전 조회 4,070
11년 전 조회 2,224
11년 전 조회 1,079
11년 전 조회 599
11년 전 조회 1,542
11년 전 조회 1,574
11년 전 조회 3,455
11년 전 조회 1,255
11년 전 조회 3,026
11년 전 조회 2,181
11년 전 조회 916
11년 전 조회 1,195
11년 전 조회 2,715
11년 전 조회 1,296
11년 전 조회 1,514
11년 전 조회 2,409
11년 전 조회 2,202
11년 전 조회 957
11년 전 조회 1,102
11년 전 조회 3,424
11년 전 조회 1,381
11년 전 조회 1,448
11년 전 조회 1,099
11년 전 조회 709
11년 전 조회 956
11년 전 조회 1,313
11년 전 조회 2,677
11년 전 조회 1,212
11년 전 조회 1,566
11년 전 조회 1,225
11년 전 조회 1,011
11년 전 조회 4,095
11년 전 조회 1,072
11년 전 조회 1,311
11년 전 조회 960
11년 전 조회 1,347
11년 전 조회 1,017
11년 전 조회 613
11년 전 조회 724
11년 전 조회 1,184
11년 전 조회 1,269
11년 전 조회 1,273
11년 전 조회 1,319
11년 전 조회 923
11년 전 조회 1,008
11년 전 조회 3,788
11년 전 조회 1,618
11년 전 조회 566
11년 전 조회 992
11년 전 조회 844
11년 전 조회 2,215
11년 전 조회 717
11년 전 조회 893
11년 전 조회 587
11년 전 조회 968
🐛 버그신고