title: Post on Facebook wall with Javascript sdk
body: <p>So, I'm trying to post on users wall using fb.api and I'm stuck.
  Here is my code:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;&lt;head&gt;&lt;meta http-           equiv="Content-Type" content="text/html; charset=windows-1251"&gt;
  &lt;title&gt;Example Of Posting To Wall Using Javascript Graph API&lt;/title&gt;
  &lt;script type="text/javascript" src=""&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body class=""&gt;
      //the facebook sdk include
      &lt;div id="fb-root" class=" fb_reset"&gt;
      &lt;script&gt;
  var APP_ID="myAppID";
  
  window.fbAsyncInit = initFacebook;
  
  function initFacebook()
  {
      FB.init({
        appId  : APP_ID,
        status : true, // check login status
        cookie : false, // enable cookies to allow the server to access the session
        xfbml  : true  // parse XFBML
      });
  
      FB.getLoginStatus(onFacebookLoginStatus);
  };
  
  (function() {
      var e = document.createElement('script');
      e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
      e.async = true;
      document.getElementById('fb-root').appendChild(e);
      }());
      //the login function
  function facebookLogin()
  {
      var loginUrl="http://www.facebook.com/dialog/oauth/?"+
          "scope=publish_stream&amp;"+
          "client_id="+APP_ID+"&amp;"+
          "redirect_uri="+document.location.href+"&amp;"+
          "response_type=token";
      window.location=loginUrl;
  }
  
  
  //Callback function for FB.login
  function onFacebookLoginStatus(response)
  {
      if (response.status=="connected" &amp;&amp; response.authResponse)
      {
          document.getElementById("txtEcho").innerHTML="Logged in.";
  
      }
      else
      {
          document.getElementById("txtEcho").innerHTML="Not logged in.";
      }
  
  }
  
  
      //post to wall function
  function postToWallUsingFBApi()
  {
      var data=
      {
          caption: 'This is my wall post example',
          message: 'Posted using FB.api',
          link: 'http://wwww.permadi.com/blog/',
       }
      FB.api('/me/feed', 'post', data, onPostToWallCompleted);
  }
  
      //the return function after posting to wall
  function onPostToWallCompleted(response)
  {
      if (response)
      {
          if (response.error)
          {
              document.getElementById("txtEcho").innerHTML=response.error.message;
          }
          else
          {
              if (response.id)
                  document.getElementById("txtEcho").innerHTML="Posted as post_id "+response.id;
              else if (response.post_id)
                  document.getElementById("txtEcho").innerHTML="Posted as post_id "+response.post_id;
              else
                  document.getElementById("txtEcho").innerHTML="Unknown Error";
          }
      }
  }
  
  
  
      &lt;/script&gt;
      &lt;input id="loginButton" type="button" value="Login To Facebook" onclick="javascript:facebookLogin();"&gt;
      &lt;input id="postToWallWithFBApiPrompt" type="button" value="Post To Wall Using FB.api"          onclick="javascript:postToWallUsingFBApi();"&gt;
      &lt;div id="txtEcho"&gt;&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>The problem here is that I receive this error code: An active access token must be used to query information about the current user.
  I get that even if I use the log in button to get the code. Is there a possibility to add previously obtained access token in function postToWallUsingFBApi(). And can I change the /me/ with user id, so that way the user can be logged out and still post?</p>