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

· 11년 전 · 1571
<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,696
10년 전 조회 2,524
10년 전 조회 1,945
10년 전 조회 2,041
10년 전 조회 1,100
10년 전 조회 1,383
10년 전 조회 1,345
10년 전 조회 982
10년 전 조회 788
10년 전 조회 985
10년 전 조회 1,690
10년 전 조회 1,019
10년 전 조회 1,938
10년 전 조회 3,698
10년 전 조회 1,511
10년 전 조회 1,371
10년 전 조회 1,319
10년 전 조회 1,309
10년 전 조회 965
10년 전 조회 2,161
10년 전 조회 890
10년 전 조회 1,321
10년 전 조회 1,429
10년 전 조회 1,497
10년 전 조회 2,515
10년 전 조회 1,230
11년 전 조회 1,685
11년 전 조회 1,094
11년 전 조회 1,112
11년 전 조회 1,978
11년 전 조회 1,396
11년 전 조회 1,198
11년 전 조회 1,590
11년 전 조회 948
11년 전 조회 1,400
11년 전 조회 1,516
11년 전 조회 4,600
11년 전 조회 1,262
11년 전 조회 985
11년 전 조회 3,521
11년 전 조회 1,486
11년 전 조회 1,257
11년 전 조회 839
11년 전 조회 843
11년 전 조회 1,745
11년 전 조회 4,100
11년 전 조회 2,254
11년 전 조회 1,119
11년 전 조회 639
11년 전 조회 1,572
11년 전 조회 1,608
11년 전 조회 3,495
11년 전 조회 1,292
11년 전 조회 3,063
11년 전 조회 2,214
11년 전 조회 956
11년 전 조회 1,222
11년 전 조회 2,746
11년 전 조회 1,332
11년 전 조회 1,551
11년 전 조회 2,450
11년 전 조회 2,242
11년 전 조회 994
11년 전 조회 1,141
11년 전 조회 3,457
11년 전 조회 1,418
11년 전 조회 1,488
11년 전 조회 1,126
11년 전 조회 740
11년 전 조회 993
11년 전 조회 1,345
11년 전 조회 2,716
11년 전 조회 1,249
11년 전 조회 1,603
11년 전 조회 1,266
11년 전 조회 1,038
11년 전 조회 4,130
11년 전 조회 1,106
11년 전 조회 1,342
11년 전 조회 1,005
11년 전 조회 1,390
11년 전 조회 1,055
11년 전 조회 654
11년 전 조회 761
11년 전 조회 1,217
11년 전 조회 1,307
11년 전 조회 1,312
11년 전 조회 1,358
11년 전 조회 960
11년 전 조회 1,043
11년 전 조회 3,833
11년 전 조회 1,657
11년 전 조회 610
11년 전 조회 1,031
11년 전 조회 877
11년 전 조회 2,247
11년 전 조회 758
11년 전 조회 932
11년 전 조회 625
11년 전 조회 1,009
🐛 버그신고