var param = { method: 'feed', message: 'blah', attachment: { name: 'JSSDK', caption: 'The Facebook JavaScript SDK', description: ( 'A small JavaScript library that allows you to harness ' + 'the power of Facebook, bringing the user\'s identity, ' + 'social graph and distribution power to your site.' ), href: 'http://fbrell.com/' }, action_links: [ { text: 'fbrell', href: 'http://fbrell.com/' } ] } // perform action FB.ui(param, g.bind(function (res){ // if mode is edit before post then on error // res will be null if (g.isNull(res) || !g.isDef(res)) { log.warning('Error from facebook. res is null'); listener(false, w.errmsg); return; } if (g.isObject(res['error'])) { log.warning('Error from facebook:' + res['error']['message']); listener(false, res['error']['message']); } else { if (this.db.editBeforePost) this.savedId = res['post_id']; else this.savedId = res; log.info('Post ok to facebook. id:' + this.savedId); listener(true, this.savedId); } }, this));