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

· 11년 전 · 1452
<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,575
10년 전 조회 2,410
10년 전 조회 1,826
10년 전 조회 1,932
10년 전 조회 986
10년 전 조회 1,267
10년 전 조회 1,238
10년 전 조회 888
10년 전 조회 667
10년 전 조회 872
10년 전 조회 1,580
10년 전 조회 911
10년 전 조회 1,821
10년 전 조회 3,579
10년 전 조회 1,398
10년 전 조회 1,254
10년 전 조회 1,207
10년 전 조회 1,180
10년 전 조회 849
10년 전 조회 2,047
10년 전 조회 769
10년 전 조회 1,209
10년 전 조회 1,300
10년 전 조회 1,380
10년 전 조회 2,406
10년 전 조회 1,103
10년 전 조회 1,574
10년 전 조회 983
11년 전 조회 996
11년 전 조회 1,862
11년 전 조회 1,281
11년 전 조회 1,076
11년 전 조회 1,480
11년 전 조회 823
11년 전 조회 1,285
11년 전 조회 1,406
11년 전 조회 4,479
11년 전 조회 1,141
11년 전 조회 873
11년 전 조회 3,399
11년 전 조회 1,368
11년 전 조회 1,134
11년 전 조회 715
11년 전 조회 726
11년 전 조회 1,635
11년 전 조회 3,992
11년 전 조회 2,143
11년 전 조회 998
11년 전 조회 525
11년 전 조회 1,453
11년 전 조회 1,491
11년 전 조회 3,374
11년 전 조회 1,171
11년 전 조회 2,952
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,033
11년 전 조회 3,349
11년 전 조회 1,301
11년 전 조회 1,367
11년 전 조회 1,030
11년 전 조회 638
11년 전 조회 877
11년 전 조회 1,232
11년 전 조회 2,591
11년 전 조회 1,146
11년 전 조회 1,482
11년 전 조회 1,150
11년 전 조회 923
11년 전 조회 4,013
11년 전 조회 990
11년 전 조회 1,229
11년 전 조회 886
11년 전 조회 1,274
11년 전 조회 945
11년 전 조회 539
11년 전 조회 650
11년 전 조회 1,117
11년 전 조회 1,188
11년 전 조회 1,192
11년 전 조회 1,238
11년 전 조회 847
11년 전 조회 938
11년 전 조회 3,718
11년 전 조회 1,547
11년 전 조회 492
11년 전 조회 918
11년 전 조회 764
11년 전 조회 2,137
11년 전 조회 634
11년 전 조회 821
11년 전 조회 516
11년 전 조회 902
🐛 버그신고