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

· 11년 전 · 2537
<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

이렇게 에러를 뿌려버립니다.

 

잘되는 소스코드가 있긴하나..

별 문제 없어보이는데 왜 안될까 싶네요..

 

만들어보신분 답변 부탁드립니다.

감사합니다.

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
11년 전 조회 2,727
11년 전 조회 3,586
11년 전 조회 2,958
11년 전 조회 3,059
11년 전 조회 2,158
11년 전 조회 2,435
11년 전 조회 2,380
11년 전 조회 2,044
11년 전 조회 1,866
11년 전 조회 2,027
11년 전 조회 2,736
11년 전 조회 2,029
11년 전 조회 2,982
11년 전 조회 4,692
11년 전 조회 2,525
11년 전 조회 2,412
11년 전 조회 2,346
11년 전 조회 2,329
11년 전 조회 1,982
11년 전 조회 3,174
11년 전 조회 1,895
11년 전 조회 2,310
11년 전 조회 2,402
11년 전 조회 2,477
11년 전 조회 3,481
11년 전 조회 2,193
11년 전 조회 2,670
11년 전 조회 2,062
11년 전 조회 2,069
11년 전 조회 2,967
11년 전 조회 2,350
11년 전 조회 2,183
11년 전 조회 2,542
11년 전 조회 1,890
11년 전 조회 2,334
11년 전 조회 2,452
11년 전 조회 5,522
11년 전 조회 2,221
11년 전 조회 1,906
11년 전 조회 4,442
11년 전 조회 2,417
11년 전 조회 2,201
11년 전 조회 1,772
11년 전 조회 1,776
11년 전 조회 2,648
11년 전 조회 5,067
11년 전 조회 3,189
11년 전 조회 2,055
11년 전 조회 1,600
11년 전 조회 2,538
11년 전 조회 2,532
11년 전 조회 4,433
11년 전 조회 2,241
11년 전 조회 4,003
11년 전 조회 3,160
11년 전 조회 1,872
11년 전 조회 2,161
11년 전 조회 3,684
11년 전 조회 2,266
11년 전 조회 2,478
11년 전 조회 3,362
11년 전 조회 3,186
11년 전 조회 1,921
11년 전 조회 2,113
11년 전 조회 4,416
11년 전 조회 2,408
11년 전 조회 2,463
11년 전 조회 2,092
11년 전 조회 1,653
11년 전 조회 1,968
11년 전 조회 2,331
11년 전 조회 3,716
11년 전 조회 2,244
11년 전 조회 2,565
11년 전 조회 2,293
11년 전 조회 2,041
11년 전 조회 5,113
11년 전 조회 2,094
11년 전 조회 2,342
11년 전 조회 2,018
11년 전 조회 2,407
11년 전 조회 2,058
11년 전 조회 1,671
11년 전 조회 1,682
11년 전 조회 2,152
11년 전 조회 2,211
11년 전 조회 2,255
11년 전 조회 2,254
11년 전 조회 1,910
11년 전 조회 1,982
11년 전 조회 4,778
11년 전 조회 2,624
11년 전 조회 1,537
11년 전 조회 1,981
11년 전 조회 1,821
11년 전 조회 3,176
11년 전 조회 1,711
11년 전 조회 1,857
11년 전 조회 1,583
11년 전 조회 1,961