简体   繁体   中英

Facebook sharer X-Frame-Options

I have my link here:

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

And my JS here:

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

But Chrome give me this error:

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

And it didn't share... Solutions?

Resolved, facebook doesn't use anymore the sharer, correct code is:

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.');
        }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM