title: Posting comment to Facebook from JavaScript
body: <p>I have a Facebook application, a Facebook page and a website. When someone adds a comment to my website, I retrieve the comment text from the code below. What I want to do after that is to let my Facebook application post the same comment text to my Facebook page.</p>
  
  <p>This is the JavaScript code I have so far on my website:</p>
  
  <pre><code> window.fbAsyncInit = function() {
       FB.init({
           appId: " . drupal_to_js($appid) . ",
           status: true,
           cookie: true,
           xfbml: true,
           channelUrl: " . drupal_to_js($channel_url) . "
       });
  
       FB.Event.subscribe('comment.create', function(response) {
          var commentQuery = FB.Data.query('SELECT text FROM comment WHERE post_fbid=\'' + response.commentID + '\' AND object_id IN (SELECT comments_fbid FROM link_stat WHERE url=\'' + response.href + '\')');
  
          FB.Data.waitOn([commentQuery], function () {
              var commentRow = commentQuery.value[0];
              var commentText = commentRow.text;
  
              //TODO Post commentText to the Facebook page.
          });
       });  };
  </code></pre>