tags:

views:

31

answers:

1

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"&gt;&lt;/script&gt;
<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!

A: 

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

John