title: Fb.api posting undefined on as wall post
body: <p>I want to post the value of an HTML id as the message on my Facebook wall. Posting to Facebook works but FB ends up writing undefined as the value pass in for message:. I am using <code>var word = document.getElementById("fb-root").value;</code> to get the value but <code>fb.api</code> is turning the value into undefined. </p>
  
  <p>Please see code below:</p>
  
  <pre><code> &lt;html&gt;
     &lt;head&gt;
       &lt;title&gt;My Facebook Login Page&lt;/title&gt;
       &lt;script type="text/javascript"&gt;
         function postToWall() {
         var word   = document.getElementById("fb-root").value;
         var params = {};
         params['message'] = word;
         params['name'] = 'test';
         params['description'] = 'test';
         params['link'] = 'asas.com';
         params['picture'] = 'http://3.bp.blogspot.com/--jbgq-gytJQ/URaJHK_93LI/AAAAAAAAAF0/SkyoK7H3r7U/s1600/Simple+Apple.png';
    params['caption'] = 'test';
  
      FB.api('/me/feed', 'post', params, function(response) {
        if (!response || response.error) {
          alert('Error occured');
        } else {
          alert(word);
        }
      });
    }
    &lt;/script&gt;
  
   &lt;div id="fb-root"&gt;test&lt;/div&gt;
    &lt;script&gt;
    window.fbAsyncInit = function() {
    FB.init({
    appId : 'test', 
    status : true,
    cookie : true,
   xfbml : true, 
    oauth : true
   });
    };
   // Load the SDK Asynchronously
   (function(d){
  var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
    if (d.getElementById(id)) {return;}
   js = d.createElement('script'); js.id = id; js.async = true;
   js.src = "//connect.facebook.net/en_US/all.js";
   ref.parentNode.insertBefore(js, ref);
   }(document));
   &lt;/script&gt;
   &lt;/head&gt;
          &lt;body&gt;
       &lt;div id="fb-root"&gt;tests&lt;/div&gt;
      &lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
      &lt;script&gt;
      FB.init({ 
        appId:&lt;fbapp-id&gt;, cookie:true, 
        status:true, xfbml:true
      });
      &lt;/script&gt;
          &lt;fb:login-button perms="publish_stream"&gt;Login with Facebook&lt;/fb:login-button&gt;
          &lt;a href="javascript:postToWall()"&gt;Post To Wall&lt;/a&gt;
         &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>