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

· 11년 전 · 1559
<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,684
10년 전 조회 2,511
10년 전 조회 1,930
10년 전 조회 2,028
10년 전 조회 1,089
10년 전 조회 1,372
10년 전 조회 1,333
10년 전 조회 969
10년 전 조회 773
10년 전 조회 969
10년 전 조회 1,677
10년 전 조회 1,006
10년 전 조회 1,924
10년 전 조회 3,685
10년 전 조회 1,494
10년 전 조회 1,355
10년 전 조회 1,309
10년 전 조회 1,292
10년 전 조회 951
10년 전 조회 2,150
10년 전 조회 874
10년 전 조회 1,308
10년 전 조회 1,413
10년 전 조회 1,482
10년 전 조회 2,508
10년 전 조회 1,213
10년 전 조회 1,675
11년 전 조회 1,079
11년 전 조회 1,098
11년 전 조회 1,964
11년 전 조회 1,380
11년 전 조회 1,184
11년 전 조회 1,579
11년 전 조회 932
11년 전 조회 1,379
11년 전 조회 1,499
11년 전 조회 4,590
11년 전 조회 1,251
11년 전 조회 971
11년 전 조회 3,507
11년 전 조회 1,474
11년 전 조회 1,246
11년 전 조회 826
11년 전 조회 826
11년 전 조회 1,731
11년 전 조회 4,085
11년 전 조회 2,244
11년 전 조회 1,105
11년 전 조회 621
11년 전 조회 1,560
11년 전 조회 1,594
11년 전 조회 3,482
11년 전 조회 1,276
11년 전 조회 3,050
11년 전 조회 2,201
11년 전 조회 945
11년 전 조회 1,211
11년 전 조회 2,736
11년 전 조회 1,315
11년 전 조회 1,536
11년 전 조회 2,431
11년 전 조회 2,226
11년 전 조회 976
11년 전 조회 1,129
11년 전 조회 3,442
11년 전 조회 1,401
11년 전 조회 1,472
11년 전 조회 1,115
11년 전 조회 727
11년 전 조회 974
11년 전 조회 1,334
11년 전 조회 2,706
11년 전 조회 1,240
11년 전 조회 1,585
11년 전 조회 1,247
11년 전 조회 1,027
11년 전 조회 4,113
11년 전 조회 1,090
11년 전 조회 1,331
11년 전 조회 986
11년 전 조회 1,373
11년 전 조회 1,039
11년 전 조회 635
11년 전 조회 745
11년 전 조회 1,202
11년 전 조회 1,290
11년 전 조회 1,297
11년 전 조회 1,342
11년 전 조회 942
11년 전 조회 1,030
11년 전 조회 3,816
11년 전 조회 1,642
11년 전 조회 589
11년 전 조회 1,018
11년 전 조회 866
11년 전 조회 2,240
11년 전 조회 740
11년 전 조회 917
11년 전 조회 609
11년 전 조회 989
🐛 버그신고