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

· 11년 전 · 1595
<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,718
10년 전 조회 2,551
10년 전 조회 1,971
10년 전 조회 2,067
10년 전 조회 1,126
10년 전 조회 1,407
10년 전 조회 1,368
10년 전 조회 1,010
10년 전 조회 813
10년 전 조회 1,004
10년 전 조회 1,720
10년 전 조회 1,047
10년 전 조회 1,961
10년 전 조회 3,725
10년 전 조회 1,535
10년 전 조회 1,393
10년 전 조회 1,346
10년 전 조회 1,325
10년 전 조회 999
10년 전 조회 2,182
10년 전 조회 914
10년 전 조회 1,348
10년 전 조회 1,452
11년 전 조회 1,523
11년 전 조회 2,546
11년 전 조회 1,248
11년 전 조회 1,712
11년 전 조회 1,122
11년 전 조회 1,137
11년 전 조회 2,005
11년 전 조회 1,424
11년 전 조회 1,225
11년 전 조회 1,618
11년 전 조회 970
11년 전 조회 1,426
11년 전 조회 1,540
11년 전 조회 4,626
11년 전 조회 1,289
11년 전 조회 1,011
11년 전 조회 3,543
11년 전 조회 1,518
11년 전 조회 1,288
11년 전 조회 859
11년 전 조회 871
11년 전 조회 1,773
11년 전 조회 4,133
11년 전 조회 2,286
11년 전 조회 1,143
11년 전 조회 672
11년 전 조회 1,596
11년 전 조회 1,628
11년 전 조회 3,516
11년 전 조회 1,321
11년 전 조회 3,091
11년 전 조회 2,243
11년 전 조회 986
11년 전 조회 1,257
11년 전 조회 2,781
11년 전 조회 1,366
11년 전 조회 1,581
11년 전 조회 2,481
11년 전 조회 2,267
11년 전 조회 1,020
11년 전 조회 1,168
11년 전 조회 3,488
11년 전 조회 1,449
11년 전 조회 1,514
11년 전 조회 1,153
11년 전 조회 767
11년 전 조회 1,022
11년 전 조회 1,376
11년 전 조회 2,750
11년 전 조회 1,276
11년 전 조회 1,632
11년 전 조회 1,292
11년 전 조회 1,070
11년 전 조회 4,148
11년 전 조회 1,136
11년 전 조회 1,371
11년 전 조회 1,033
11년 전 조회 1,409
11년 전 조회 1,079
11년 전 조회 677
11년 전 조회 794
11년 전 조회 1,244
11년 전 조회 1,335
11년 전 조회 1,340
11년 전 조회 1,387
11년 전 조회 996
11년 전 조회 1,062
11년 전 조회 3,859
11년 전 조회 1,695
11년 전 조회 639
11년 전 조회 1,063
11년 전 조회 897
11년 전 조회 2,281
11년 전 조회 785
11년 전 조회 962
11년 전 조회 660
11년 전 조회 1,043
🐛 버그신고