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

· 11년 전 · 1486
<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,615
10년 전 조회 2,450
10년 전 조회 1,862
10년 전 조회 1,964
10년 전 조회 1,025
10년 전 조회 1,302
10년 전 조회 1,275
10년 전 조회 918
10년 전 조회 710
10년 전 조회 911
10년 전 조회 1,617
10년 전 조회 943
10년 전 조회 1,856
10년 전 조회 3,620
10년 전 조회 1,434
10년 전 조회 1,286
10년 전 조회 1,242
10년 전 조회 1,215
10년 전 조회 889
10년 전 조회 2,085
10년 전 조회 805
10년 전 조회 1,244
10년 전 조회 1,336
10년 전 조회 1,417
10년 전 조회 2,437
10년 전 조회 1,137
10년 전 조회 1,612
11년 전 조회 1,016
11년 전 조회 1,033
11년 전 조회 1,895
11년 전 조회 1,322
11년 전 조회 1,120
11년 전 조회 1,513
11년 전 조회 857
11년 전 조회 1,313
11년 전 조회 1,440
11년 전 조회 4,510
11년 전 조회 1,175
11년 전 조회 910
11년 전 조회 3,436
11년 전 조회 1,405
11년 전 조회 1,172
11년 전 조회 748
11년 전 조회 758
11년 전 조회 1,667
11년 전 조회 4,026
11년 전 조회 2,172
11년 전 조회 1,027
11년 전 조회 560
11년 전 조회 1,487
11년 전 조회 1,522
11년 전 조회 3,407
11년 전 조회 1,203
11년 전 조회 2,974
11년 전 조회 2,130
11년 전 조회 866
11년 전 조회 1,142
11년 전 조회 2,668
11년 전 조회 1,239
11년 전 조회 1,457
11년 전 조회 2,359
11년 전 조회 2,148
11년 전 조회 912
11년 전 조회 1,062
11년 전 조회 3,375
11년 전 조회 1,330
11년 전 조회 1,393
11년 전 조회 1,060
11년 전 조회 658
11년 전 조회 904
11년 전 조회 1,257
11년 전 조회 2,622
11년 전 조회 1,173
11년 전 조회 1,508
11년 전 조회 1,180
11년 전 조회 953
11년 전 조회 4,044
11년 전 조회 1,023
11년 전 조회 1,258
11년 전 조회 912
11년 전 조회 1,303
11년 전 조회 972
11년 전 조회 564
11년 전 조회 678
11년 전 조회 1,137
11년 전 조회 1,216
11년 전 조회 1,220
11년 전 조회 1,267
11년 전 조회 877
11년 전 조회 960
11년 전 조회 3,747
11년 전 조회 1,577
11년 전 조회 519
11년 전 조회 946
11년 전 조회 785
11년 전 조회 2,159
11년 전 조회 660
11년 전 조회 842
11년 전 조회 540
11년 전 조회 928
🐛 버그신고