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

· 11년 전 · 1596
<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,718
10년 전 조회 2,552
10년 전 조회 1,972
10년 전 조회 2,067
10년 전 조회 1,128
10년 전 조회 1,407
10년 전 조회 1,370
10년 전 조회 1,010
10년 전 조회 815
10년 전 조회 1,005
10년 전 조회 1,722
10년 전 조회 1,052
10년 전 조회 1,964
10년 전 조회 3,729
10년 전 조회 1,536
10년 전 조회 1,394
10년 전 조회 1,346
10년 전 조회 1,327
10년 전 조회 1,000
10년 전 조회 2,183
10년 전 조회 915
10년 전 조회 1,349
10년 전 조회 1,454
11년 전 조회 1,523
11년 전 조회 2,546
11년 전 조회 1,249
11년 전 조회 1,714
11년 전 조회 1,123
11년 전 조회 1,137
11년 전 조회 2,006
11년 전 조회 1,425
11년 전 조회 1,227
11년 전 조회 1,618
11년 전 조회 971
11년 전 조회 1,427
11년 전 조회 1,541
11년 전 조회 4,627
11년 전 조회 1,290
11년 전 조회 1,011
11년 전 조회 3,543
11년 전 조회 1,518
11년 전 조회 1,290
11년 전 조회 860
11년 전 조회 873
11년 전 조회 1,774
11년 전 조회 4,134
11년 전 조회 2,286
11년 전 조회 1,143
11년 전 조회 676
11년 전 조회 1,597
11년 전 조회 1,631
11년 전 조회 3,518
11년 전 조회 1,323
11년 전 조회 3,091
11년 전 조회 2,244
11년 전 조회 986
11년 전 조회 1,257
11년 전 조회 2,783
11년 전 조회 1,366
11년 전 조회 1,581
11년 전 조회 2,481
11년 전 조회 2,269
11년 전 조회 1,020
11년 전 조회 1,168
11년 전 조회 3,489
11년 전 조회 1,450
11년 전 조회 1,516
11년 전 조회 1,155
11년 전 조회 767
11년 전 조회 1,022
11년 전 조회 1,377
11년 전 조회 2,750
11년 전 조회 1,277
11년 전 조회 1,632
11년 전 조회 1,292
11년 전 조회 1,072
11년 전 조회 4,150
11년 전 조회 1,136
11년 전 조회 1,373
11년 전 조회 1,034
11년 전 조회 1,414
11년 전 조회 1,079
11년 전 조회 677
11년 전 조회 794
11년 전 조회 1,246
11년 전 조회 1,335
11년 전 조회 1,340
11년 전 조회 1,387
11년 전 조회 996
11년 전 조회 1,063
11년 전 조회 3,860
11년 전 조회 1,698
11년 전 조회 639
11년 전 조회 1,064
11년 전 조회 898
11년 전 조회 2,283
11년 전 조회 786
11년 전 조회 964
11년 전 조회 661
11년 전 조회 1,043
🐛 버그신고