haemse
haemse

Reputation: 4273

Posting on Facebook ... works fine but throws error in console WHY?

i set up a FB.ui feed for triggering a Dialog with Facebook like it is described here.

Everything works fine so far. The dialog gets posted on the fb users profile, but when the fb site opens for the useraction to publish the dialog it throws an error hundreds of times in the js console until the user skips or publishes:

The error (130 times): Unsafe JavaScript attempt to access frame with URL ... . Domains, protocols and ports must match.

The appId wich with i init the fbjs sdk is registered with the used domain:

sub.mydomain.com

the handed over json looks like this:

Code:

window.fbAsyncInit = function() {
    FB.init({appId: '209836882377466', status: true, cookie: true,
        xfbml: true
    });             
};          
(function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    if (!$('#fb-root script').length>0){
        document.getElementById('fb-root').appendChild(e);
    }

}());

here the feed:

 var jSON = {
                method: 'feed',
                name: $('#fbName input').val(),
                link: basicLnkStruct + phpSessionID,
                picture: homeURL + imgPath,
                caption: ' ',
                description: $('.fbDescript textarea').val(),
                message: ''
            };
    FB.ui(
        jSON
        ,
        function(response) {
            if (response && response.post_id) {
                 //alert('Post was published.');
            } else {
                //alert('Post was not published.');
            }
        }

    );

Why is it throwing that error?

Upvotes: 2

Views: 711

Answers (1)

Related Questions