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

· 11년 전 · 1455
<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,578
10년 전 조회 2,413
10년 전 조회 1,829
10년 전 조회 1,934
10년 전 조회 989
10년 전 조회 1,269
10년 전 조회 1,240
10년 전 조회 890
10년 전 조회 671
10년 전 조회 876
10년 전 조회 1,582
10년 전 조회 914
10년 전 조회 1,825
10년 전 조회 3,583
10년 전 조회 1,401
10년 전 조회 1,258
10년 전 조회 1,210
10년 전 조회 1,184
10년 전 조회 852
10년 전 조회 2,050
10년 전 조회 772
10년 전 조회 1,212
10년 전 조회 1,303
10년 전 조회 1,383
10년 전 조회 2,409
10년 전 조회 1,107
10년 전 조회 1,577
11년 전 조회 987
11년 전 조회 998
11년 전 조회 1,864
11년 전 조회 1,283
11년 전 조회 1,080
11년 전 조회 1,482
11년 전 조회 826
11년 전 조회 1,286
11년 전 조회 1,407
11년 전 조회 4,481
11년 전 조회 1,144
11년 전 조회 876
11년 전 조회 3,401
11년 전 조회 1,370
11년 전 조회 1,137
11년 전 조회 718
11년 전 조회 727
11년 전 조회 1,638
11년 전 조회 3,995
11년 전 조회 2,147
11년 전 조회 1,001
11년 전 조회 527
11년 전 조회 1,456
11년 전 조회 1,494
11년 전 조회 3,376
11년 전 조회 1,171
11년 전 조회 2,953
11년 전 조회 2,102
11년 전 조회 834
11년 전 조회 1,115
11년 전 조회 2,639
11년 전 조회 1,213
11년 전 조회 1,429
11년 전 조회 2,329
11년 전 조회 2,121
11년 전 조회 889
11년 전 조회 1,034
11년 전 조회 3,349
11년 전 조회 1,301
11년 전 조회 1,367
11년 전 조회 1,031
11년 전 조회 639
11년 전 조회 878
11년 전 조회 1,234
11년 전 조회 2,592
11년 전 조회 1,148
11년 전 조회 1,483
11년 전 조회 1,151
11년 전 조회 925
11년 전 조회 4,014
11년 전 조회 990
11년 전 조회 1,230
11년 전 조회 886
11년 전 조회 1,276
11년 전 조회 945
11년 전 조회 540
11년 전 조회 650
11년 전 조회 1,117
11년 전 조회 1,189
11년 전 조회 1,192
11년 전 조회 1,240
11년 전 조회 847
11년 전 조회 939
11년 전 조회 3,719
11년 전 조회 1,547
11년 전 조회 493
11년 전 조회 921
11년 전 조회 764
11년 전 조회 2,137
11년 전 조회 636
11년 전 조회 821
11년 전 조회 516
11년 전 조회 902
🐛 버그신고