[Answer]-Javascript function into a loop, Django app

1👍

Try placing single quotes around {{friend.uid}}

onclick="FacebookInviteOneFriend('{{friend.uid}}');"

Also try adding a debug statement to your function to see what, if any, value is being passed:

function FacebookInviteOneFriend(UserId) {
    alert(UserId);

    FB.ui({
        method: 'apprequests',
        message: 'My message'
        to: UserId
    });
}

Leave a comment