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

· 11년 전 · 1496
<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,619
10년 전 조회 2,457
10년 전 조회 1,869
10년 전 조회 1,968
10년 전 조회 1,030
10년 전 조회 1,311
10년 전 조회 1,282
10년 전 조회 923
10년 전 조회 718
10년 전 조회 915
10년 전 조회 1,623
10년 전 조회 947
10년 전 조회 1,860
10년 전 조회 3,628
10년 전 조회 1,437
10년 전 조회 1,291
10년 전 조회 1,246
10년 전 조회 1,218
10년 전 조회 893
10년 전 조회 2,089
10년 전 조회 815
10년 전 조회 1,247
10년 전 조회 1,343
10년 전 조회 1,421
10년 전 조회 2,444
10년 전 조회 1,143
10년 전 조회 1,621
11년 전 조회 1,021
11년 전 조회 1,039
11년 전 조회 1,901
11년 전 조회 1,328
11년 전 조회 1,126
11년 전 조회 1,521
11년 전 조회 864
11년 전 조회 1,319
11년 전 조회 1,447
11년 전 조회 4,515
11년 전 조회 1,183
11년 전 조회 914
11년 전 조회 3,446
11년 전 조회 1,414
11년 전 조회 1,181
11년 전 조회 752
11년 전 조회 766
11년 전 조회 1,673
11년 전 조회 4,030
11년 전 조회 2,178
11년 전 조회 1,031
11년 전 조회 564
11년 전 조회 1,497
11년 전 조회 1,526
11년 전 조회 3,412
11년 전 조회 1,208
11년 전 조회 2,977
11년 전 조회 2,137
11년 전 조회 870
11년 전 조회 1,148
11년 전 조회 2,673
11년 전 조회 1,243
11년 전 조회 1,461
11년 전 조회 2,364
11년 전 조회 2,151
11년 전 조회 917
11년 전 조회 1,067
11년 전 조회 3,378
11년 전 조회 1,333
11년 전 조회 1,397
11년 전 조회 1,063
11년 전 조회 663
11년 전 조회 909
11년 전 조회 1,265
11년 전 조회 2,629
11년 전 조회 1,179
11년 전 조회 1,515
11년 전 조회 1,182
11년 전 조회 959
11년 전 조회 4,049
11년 전 조회 1,028
11년 전 조회 1,260
11년 전 조회 917
11년 전 조회 1,306
11년 전 조회 975
11년 전 조회 569
11년 전 조회 682
11년 전 조회 1,141
11년 전 조회 1,218
11년 전 조회 1,223
11년 전 조회 1,270
11년 전 조회 882
11년 전 조회 964
11년 전 조회 3,749
11년 전 조회 1,579
11년 전 조회 523
11년 전 조회 951
11년 전 조회 791
11년 전 조회 2,163
11년 전 조회 664
11년 전 조회 847
11년 전 조회 543
11년 전 조회 931
🐛 버그신고