Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm using the Javascript SDK to allow the user to login to facebook, retrieve their friends profile pictures, and then finally post a message on the logged in users wall. Problem is I keep getting an error, "Error while loading page from Pencils of Promise," when the user has to authorize the application.

<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({appId: '154058871279888', status: true, cookie: true,
             xfbml: true});

console.log(FB.getLoginStatus());

$('div.voice-btn:eq(0)').click(function() {
    FB.login(function(response) {
        if(response.session) {                
            FB.api('/me', function(data) {
                console.log(data);
            });

            donateVoiceSlider();
          }
    });
});

$('#voice-step-2-btn').click(function() {
    var body = 'Test Facebook post';
    FB.api('/me/feed', 'post', { body: body }, function(response) {
         if (!response || response.error) {
            alert('Error occured');
        } else {
            alert('Post ID: ' + response);
        }
    });
});

// Donate Voice Content Slider
function donateVoiceSlider() {
    var $ul = $('#donatevoice');
    var cur_left = parseInt($ul.css('left'));
    var li_width = 980;

    $ul.animate( {'left': cur_left-li_width+'px'} );
}
</script>

Please help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
139 views
Welcome To Ask or Share your Answers For Others

1 Answer

My friend who had created the application did NOT set the site URL. After doing that, everything ran smoothly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...