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

· 11년 전 · 1609
<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,729
10년 전 조회 2,562
10년 전 조회 1,983
10년 전 조회 2,071
10년 전 조회 1,139
10년 전 조회 1,416
10년 전 조회 1,379
10년 전 조회 1,025
10년 전 조회 823
10년 전 조회 1,019
10년 전 조회 1,729
10년 전 조회 1,061
10년 전 조회 1,971
10년 전 조회 3,734
10년 전 조회 1,546
10년 전 조회 1,403
10년 전 조회 1,355
10년 전 조회 1,338
10년 전 조회 1,012
10년 전 조회 2,195
10년 전 조회 928
10년 전 조회 1,355
11년 전 조회 1,462
11년 전 조회 1,535
11년 전 조회 2,551
11년 전 조회 1,260
11년 전 조회 1,722
11년 전 조회 1,135
11년 전 조회 1,153
11년 전 조회 2,018
11년 전 조회 1,436
11년 전 조회 1,233
11년 전 조회 1,626
11년 전 조회 981
11년 전 조회 1,437
11년 전 조회 1,553
11년 전 조회 4,636
11년 전 조회 1,299
11년 전 조회 1,021
11년 전 조회 3,551
11년 전 조회 1,528
11년 전 조회 1,297
11년 전 조회 872
11년 전 조회 885
11년 전 조회 1,782
11년 전 조회 4,145
11년 전 조회 2,293
11년 전 조회 1,150
11년 전 조회 683
11년 전 조회 1,610
11년 전 조회 1,642
11년 전 조회 3,533
11년 전 조회 1,327
11년 전 조회 3,100
11년 전 조회 2,253
11년 전 조회 989
11년 전 조회 1,264
11년 전 조회 2,788
11년 전 조회 1,374
11년 전 조회 1,585
11년 전 조회 2,487
11년 전 조회 2,277
11년 전 조회 1,034
11년 전 조회 1,182
11년 전 조회 3,499
11년 전 조회 1,463
11년 전 조회 1,524
11년 전 조회 1,171
11년 전 조회 771
11년 전 조회 1,029
11년 전 조회 1,389
11년 전 조회 2,758
11년 전 조회 1,296
11년 전 조회 1,642
11년 전 조회 1,305
11년 전 조회 1,082
11년 전 조회 4,164
11년 전 조회 1,151
11년 전 조회 1,388
11년 전 조회 1,042
11년 전 조회 1,428
11년 전 조회 1,087
11년 전 조회 687
11년 전 조회 805
11년 전 조회 1,257
11년 전 조회 1,343
11년 전 조회 1,350
11년 전 조회 1,401
11년 전 조회 1,008
11년 전 조회 1,078
11년 전 조회 3,871
11년 전 조회 1,711
11년 전 조회 653
11년 전 조회 1,078
11년 전 조회 906
11년 전 조회 2,294
11년 전 조회 798
11년 전 조회 971
11년 전 조회 668
11년 전 조회 1,051
🐛 버그신고