0

我有我的鏈接在這裏:這裏Facebook的分享者X框,選擇

<a name="fb_share" type="icon_link" share_url="" href=""> 
    <button class="btn btn-large btn-primary tasto" disabled="disabled">Condividi contenuto</button> 
</a> 

而我的JS:

FB.api('/217822418323942', 
function(response){ 
     $('.step_4').children('a').attr('href', 'http://www.facebook.com/sharer.php?u='+response.link+'&t=CONDIVIDI!'); 
}); 

而Chrome給我這個錯誤:

Refused to display document because display forbidden by X-Frame-Options. 

而且它沒有分享......解決方案?

回答

0

解決,Facebook並沒有再使用共享資源,正確的代碼是:

FB.ui({ 
    method: 'feed', 
    name: response.from.name, 
    link: response.link, 
    picture: 'http://images.sodahead.com/polls/002641083/3649326924_lol_guy_answer_1_xlarge.jpeg', 
    caption: 'LOL.', 
    description: 'meme' 
}, 
function(response) { 
    if (response && response.post_id) { 
     console.log('Post was published.'); 
     } else { 
      console.log('Post was not published.'); 
     } 
});