I have:
$.post( "https://host.com/save.php", { 'fb_id': userID, 'meth': 'get_db_ID' }, function(data) { link_id = data; console.log('from method' + link_id); }); FB.ui({ method: 'feed', name: 'My title for a link.', caption: ' ', description: 'My description', link: 'https://www.facebook.com/pages/Page-Test/1417010325197563?id=1417010325197563&sk=app_1413297985570561&app_data=u_id|'+link_id, picture: 'http://host.com/myimage.png' }, function(response) { console.log('publishStory response: ', response); }); But the var link_id I have defined previously and have assigned a user's id, doesn't display.